<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 649</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="649"></A><H4>649.
  
Optionally ill-formed extended alignment requests
</H4>
<B>Section: </B>6.8.3&#160; [<A href="https://wg21.link/basic.align">basic.align</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD1
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>12 Aug 2007<BR>


<P>[Voted into the WP at the September, 2008 meeting.]</P>



<P>The requirements on an implementation when presented with an
<I>alignment-specifier</I> not supported by that implementation in
that context are contradictory: 6.8.3 [<A href="https://wg21.link/basic.align#9">basic.align</A>] paragraph 9
says,</P>

<BLOCKQUOTE>

If a request for a specific extended alignment in a specific context
is not supported by an implementation, the implementation may reject
the request as ill-formed. The implementation may also silently ignore
the requested alignment.

</BLOCKQUOTE>

<P>In contrast, 9.13.2 [<A href="https://wg21.link/dcl.align#2">dcl.align</A>] paragraph 2, bullet 4
says simply,</P>

<BLOCKQUOTE>

<UL>
<LI>if the constant expression evaluates to an extended alignment and
the implementation does not support that alignment in the context of
the declaration, the program is ill-formed</LI>
</UL>

</BLOCKQUOTE>

<P>with no provision to &#8220;silently ignore&#8221; the requested
alignment.  These two passages need to be reconciled.</P>

<P>If the outcome of the reconciliation is to grant implementations
the license to accept and ignore extended alignment requests, the
specification should be framed in terms of mechanisms that already
exist in the Standard, such as undefined behavior and/or
conditionally-supported constructs; &#8220;ill-formed&#8221; is a
category that is defined by the Standard, not something that an
implementation can decide.</P>

<P><B>Notes from the February, 2008 meeting:</B></P>

<P>The consensus was that such requests should be ill-formed and
require a diagnostic.  However, it was also observed that an
implementation need not reject an ill-formed program; the only
requirement is that it issue a diagnostic.  It would thus be
permissible for an implementation to &#8220;noisily ignore&#8221;
(as opposed to &#8220;silently ignoring&#8221;) an unsupported
alignment request.</P>

<P><B>Proposed resolution (June, 2008):</B></P>

<P>Change 6.8.3 [<A href="https://wg21.link/basic.align#9">basic.align</A>] paragraph 9 as follows:</P>

<BLOCKQUOTE>

If a request for a specific extended alignment in a specific context
is not supported by an implementation, the <DEL>implementation may
reject the request as</DEL> <INS>program is</INS> ill-formed. <DEL>The
implementation may also silently ignore the requested
alignment. [Note: a</DEL><INS>A</INS>dditionally, a request for runtime
allocation of dynamic <DEL>memory</DEL> <INS>storage</INS> for which the
requested alignment cannot be honored <DEL>may</DEL> <INS>shall</INS> be
treated as an allocation failure. <DEL>&#8212;<I>end note</I>]</DEL>

</BLOCKQUOTE>

<BR><BR>
</BODY>
</HTML>
