public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58016] stdatomic.h missing in 4.8.1
       [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
@ 2013-07-28 18:31 ` paolo.carlini at oracle dot com
  2013-07-28 19:27 ` joseph at codesourcery dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-28 18:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/58016] stdatomic.h missing in 4.8.1
       [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
  2013-07-28 18:31 ` [Bug c/58016] stdatomic.h missing in 4.8.1 paolo.carlini at oracle dot com
@ 2013-07-28 19:27 ` joseph at codesourcery dot com
  2013-07-28 20:42 ` jeff.science at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: joseph at codesourcery dot com @ 2013-07-28 19:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
I don't know whether Andrew intends stdatomic.h to go in GCC or glibc, but 
in any case I consider this a duplicate of bug 53769, which in turn I 
don't really consider a useful bug report at all (incompleteness of the 
implementation of an option documented in the manual as incomplete should 
not be considered a bug).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/58016] stdatomic.h missing in 4.8.1
       [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
  2013-07-28 18:31 ` [Bug c/58016] stdatomic.h missing in 4.8.1 paolo.carlini at oracle dot com
  2013-07-28 19:27 ` joseph at codesourcery dot com
@ 2013-07-28 20:42 ` jeff.science at gmail dot com
  2013-07-29 13:43 ` joseph at codesourcery dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jeff.science at gmail dot com @ 2013-07-28 20:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016

--- Comment #2 from Jeff Hammond <jeff.science at gmail dot com> ---
If GCC doesn't support C11, it should not claim to support C11 via
__STDC_VERSION__.  The C11 standard definition isn't a recommendation from
which implementers can pick and choose based upon their priorities. 
Documentation an implementations failure to comply with a standard does not
absolve an implementation from lying about its features with ISO standard
macros.  The macro is part of the standard; the documentation is not.

In any case, there is an absolutely trivial way for GCC to satisfy the C11
standard with respect to stdatomic.h, and it involves __STDC_NO_ATOMICS__.  The
failure to define this macro or to provide stdatomic.h make GCC non-compliant
with C11, in which case __STDC_VERSION__ is defined improperly.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/58016] stdatomic.h missing in 4.8.1
       [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-07-28 20:42 ` jeff.science at gmail dot com
@ 2013-07-29 13:43 ` joseph at codesourcery dot com
  2013-07-29 16:15 ` jeff.science at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: joseph at codesourcery dot com @ 2013-07-29 13:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016

--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
__STDC_VERSION__ describes *intent* of command-line options (as regards 
differences between standard versions, to the extent that those are 
implemented).  This is the same principle that has been documented for 
__STDC__ since at least GCC 2.0.

  "Sometimes people say that defining @code{__STDC__} in a compiler that
  does not completely conform to the ANSI C standard somehow violates the
  standard.  This is illogical.  The standard is a standard for compilers
  that are supposed to conform.  It says nothing about what any other
  compilers should do.  Whatever the ANSI C standard says is relevant to
  the design of plain @samp{gcc} without @samp{-ansi} only for pragmatic
  reasons, not as a requirement."

(quoted from the GCC 2.0 manual).

As a pragmatic matter, it's useful for users of standards modes that are 
incomplete to be able to tell which of those modes is in use, and 
__STDC_VERSION__ is the natural macro to define to distinguish between 
them.  gcc -std=c11 is a compiler explicitly claimed not to conform.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/58016] stdatomic.h missing in 4.8.1
       [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-07-29 13:43 ` joseph at codesourcery dot com
@ 2013-07-29 16:15 ` jeff.science at gmail dot com
  2013-07-29 16:34 ` jeff.science at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jeff.science at gmail dot com @ 2013-07-29 16:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016

--- Comment #5 from Jeff Hammond <jeff.science at gmail dot com> ---
Can someone tell me where the appropriate place to define __STDC_NO_ATOMICS__
and __STDC_NO_THREADS__ in GCC so I can submit a patch?  I'd rather solve the
problem and take 1-2 steps forward towards C11 compliance rather than debate
the philosophical aspects of the problem.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/58016] stdatomic.h missing in 4.8.1
       [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2013-07-29 16:15 ` jeff.science at gmail dot com
@ 2013-07-29 16:34 ` jeff.science at gmail dot com
  2013-07-29 16:39 ` joseph at codesourcery dot com
  2013-07-29 18:46 ` jeff.science at gmail dot com
  7 siblings, 0 replies; 8+ messages in thread
From: jeff.science at gmail dot com @ 2013-07-29 16:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016

Jeff Hammond <jeff.science at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeff.science at gmail dot com

--- Comment #6 from Jeff Hammond <jeff.science at gmail dot com> ---
Created attachment 30568
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30568&action=edit
patch to define macros indicating missing C11 support

If GCC defines __STDC_NO_ATOMICS__ and __STDC_NO_THREADS__, it is no longer
non-compliant w.r.t. C11 to not provide stdatomic.h and threads.h.  This would
resolve bugs 53769 and 58016, albeit in a trivial way.

I will not be surprised at all if this patch is rejected, if for no other
reason than my institution has not signed a contributor agreement with FSF
(they almost certainly will if I ask).  My goal is to inspire someone else to
do it properly since it seems trivial and arguably necessary.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/58016] stdatomic.h missing in 4.8.1
       [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2013-07-29 16:34 ` jeff.science at gmail dot com
@ 2013-07-29 16:39 ` joseph at codesourcery dot com
  2013-07-29 18:46 ` jeff.science at gmail dot com
  7 siblings, 0 replies; 8+ messages in thread
From: joseph at codesourcery dot com @ 2013-07-29 16:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016

--- Comment #7 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
__STDC_NO_THREADS__ is defined in glibc's stdc-predef.h because it 
describes combination compiler and library properties.

The correct fix for atomics for 4.9 will be to implement them - see Andrew 
MacLeod's patches and recent discussion on gcc-patches - and the state of 
C11 in 4.8 is what it is and 4.8 is subject to normal release branch rules 
(regression and documentation fixes only, generally).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/58016] stdatomic.h missing in 4.8.1
       [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2013-07-29 16:39 ` joseph at codesourcery dot com
@ 2013-07-29 18:46 ` jeff.science at gmail dot com
  7 siblings, 0 replies; 8+ messages in thread
From: jeff.science at gmail dot com @ 2013-07-29 18:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016

Jeff Hammond <jeff.science at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #8 from Jeff Hammond <jeff.science at gmail dot com> ---
My patch was w.r.t. the trunk as of earlier today, not 4.8 but that's fine.  I
just subscribed to various GCC lists to track these developments.

I'll apply my patch locally so that I can use 4.8.1 and get the desired
behavior.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-29 18:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-58016-4@http.gcc.gnu.org/bugzilla/>
2013-07-28 18:31 ` [Bug c/58016] stdatomic.h missing in 4.8.1 paolo.carlini at oracle dot com
2013-07-28 19:27 ` joseph at codesourcery dot com
2013-07-28 20:42 ` jeff.science at gmail dot com
2013-07-29 13:43 ` joseph at codesourcery dot com
2013-07-29 16:15 ` jeff.science at gmail dot com
2013-07-29 16:34 ` jeff.science at gmail dot com
2013-07-29 16:39 ` joseph at codesourcery dot com
2013-07-29 18:46 ` jeff.science at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).