public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
@ 2010-12-26 18:06 ` bruno at clisp dot org
  2010-12-26 18:36 ` paolo.carlini at oracle dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: bruno at clisp dot org @ 2010-12-26 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

bruno at clisp dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bruno at clisp dot org

--- Comment #17 from bruno at clisp dot org 2010-12-26 18:06:15 UTC ---
Note that the use of values-xpg6.o leads to unexpected behaviour when
considering shared libraries:

1) The behaviour of a shared library also depends on whether the executable
is linked with or without values-xpg6.o. The author of the shared library
may not expect this and may not have tested in this situation.

2) The behaviour of an executable also depends on whether some of the shared
libraries was built with values-xpg6.o. The author of the program may not
expect this. This leads to real bugs:
<http://lists.gnu.org/archive/html/autoconf/2010-02/msg00013.html>

More details in
<http://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html>

For this reason, I would find it bad if "gcc -std=c99" or "gcc -std=gnu99"
would cause values-xpg6.o to be included in the link. Please close this
issue as "Won't fix". Programs which wish to have POSIX compliant behaviour
of system functions can use GNU gnulib; it doesn't rely on values-xpg6.o.


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
  2010-12-26 18:06 ` [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library bruno at clisp dot org
@ 2010-12-26 18:36 ` paolo.carlini at oracle dot com
  2010-12-26 21:52 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-12-26 18:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-12-26 18:35:49 UTC ---
Rainer, can you have another look to this issue and possibly actually close it?


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
  2010-12-26 18:06 ` [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library bruno at clisp dot org
  2010-12-26 18:36 ` paolo.carlini at oracle dot com
@ 2010-12-26 21:52 ` redi at gcc dot gnu.org
  2010-12-27 19:17 ` pogma at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: redi at gcc dot gnu.org @ 2010-12-26 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-12-26 21:52:07 UTC ---
(In reply to comment #17)
> For this reason, I would find it bad if "gcc -std=c99" or "gcc -std=gnu99"
> would cause values-xpg6.o to be included in the link. Please close this
> issue as "Won't fix". Programs which wish to have POSIX compliant behaviour
> of system functions can use GNU gnulib; it doesn't rely on values-xpg6.o.

I don't entirely agree with this line of reasoning. If the system provides a
POSIX compliant C library it's reasonable to want to use it and users will want
some way to tel the compiler to do so. Whether using it is enabled via -std or
not, linking to values-xpg6.o can cause unexpected behaviour for applications
or shared objects.

It does seem reasonable to expect -std=c99 to enable C99 features if the system
supports them, and similarly for -std=c++0x


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2010-12-26 21:52 ` redi at gcc dot gnu.org
@ 2010-12-27 19:17 ` pogma at gcc dot gnu.org
  2011-01-04 18:11 ` gseanmcg at gmail dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: pogma at gcc dot gnu.org @ 2010-12-27 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

pogma@gcc.gnu.org <pogma at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pogma at gcc dot gnu.org

--- Comment #20 from pogma at gcc dot gnu.org <pogma at gcc dot gnu.org> 2010-12-27 19:17:18 UTC ---
(In reply to comment #19)
> Whether using it is enabled via -std or
> not, linking to values-xpg6.o can cause unexpected behaviour for applications
> or shared objects.

Yes, it can, and that behaviour change is surprising, especially if relinking a
library with a newer gcc (using the same flags as it was linked with using an
older version of the compiler) can cause clients of that library to stop
working or to behave in a different manner.

If a user really wants the xpg6 behaviour from libc they can simply add the
relevant object file to their output or even just define the __xpg4 and __xpg6
symbols in their application, or, as Bruno suggests - use gnulib.


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2010-12-27 19:17 ` pogma at gcc dot gnu.org
@ 2011-01-04 18:11 ` gseanmcg at gmail dot com
  2011-01-05 21:14 ` gseanmcg at gmail dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: gseanmcg at gmail dot com @ 2011-01-04 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Sean McGovern <gseanmcg at gmail dot com> 2011-01-04 18:11:09 UTC ---
Why not introduce a warning for 4.6 that it is linking against this object file
and that any other libraries alongside that are not tested against C99 may
experience side effects, with eventual deprecation (of the warning) later on in
4.7 or 4.8?

Is this appropriate to do inside collect2?


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-01-04 18:11 ` gseanmcg at gmail dot com
@ 2011-01-05 21:14 ` gseanmcg at gmail dot com
  2011-03-07 20:16 ` gseanmcg at gmail dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: gseanmcg at gmail dot com @ 2011-01-05 21:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from Sean McGovern <gseanmcg at gmail dot com> 2011-01-05 19:50:09 UTC ---
Sorry, still learning -- collect2 is definitely not the place for this.

Target-specific plugin maybe?


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-01-05 21:14 ` gseanmcg at gmail dot com
@ 2011-03-07 20:16 ` gseanmcg at gmail dot com
  2011-11-25 16:33 ` gseanmcg at gmail dot com
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: gseanmcg at gmail dot com @ 2011-03-07 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from Sean McGovern <gseanmcg at gmail dot com> 2011-03-07 20:16:09 UTC ---
Ping.


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2011-03-07 20:16 ` gseanmcg at gmail dot com
@ 2011-11-25 16:33 ` gseanmcg at gmail dot com
  2011-11-25 17:18 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: gseanmcg at gmail dot com @ 2011-11-25 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 from Sean McGovern <gseanmcg at gmail dot com> 2011-11-25 16:25:02 UTC ---
Ping^2.


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2011-11-25 16:33 ` gseanmcg at gmail dot com
@ 2011-11-25 17:18 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2011-11-25 17:24 ` joseph at codesourcery dot com
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 29+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2011-11-25 17:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> 2011-11-25 16:34:03 UTC ---
No progress yet: an attempt to handle this via specs some time ago
failed since there was some of Joseph's option work missing.

    Rainer


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2011-11-25 17:18 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2011-11-25 17:24 ` joseph at codesourcery dot com
  2012-06-01 14:24 ` gseanmcg at gmail dot com
  2013-08-06  0:21 ` lionelcons1972 at gmail dot com
  11 siblings, 0 replies; 29+ messages in thread
From: joseph at codesourcery dot com @ 2011-11-25 17:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #26 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-11-25 17:15:31 UTC ---
All the various options equivalent to -std=c99 now map to -std=c99 using 
Alias in the .opt file, so specs only need to handle that one spelling.  
The same applies with -std=gnu99.

Note that -ansi and -std=c90 are not marked as Aliases for each other 
because the meaning of -ansi depends on whether C or C++ is being built.


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2011-11-25 17:24 ` joseph at codesourcery dot com
@ 2012-06-01 14:24 ` gseanmcg at gmail dot com
  2013-08-06  0:21 ` lionelcons1972 at gmail dot com
  11 siblings, 0 replies; 29+ messages in thread
From: gseanmcg at gmail dot com @ 2012-06-01 14:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #27 from Sean McGovern <gseanmcg at gmail dot com> 2012-06-01 14:23:21 UTC ---
I just found out how ugly this can get.

freopen(3C) has different behaviour in the case where the first argument is
NULL depending on if SUSv3 behaviour has been enabled by including
values-xpg6.o and defining _XOPEN_SOURCE = 600.

Here's the prototype from Solaris 10 8/11:
FILE *freopen(const char *filename, const char *mode, FILE *stream);

>From the freopen(3C) manpage:
If filename is a null pointer and the application comforms to SUSv3 (see
standards(5)), the freopen() function attempts to change the mode of the stream
to that specified by mode, as though the name of the file currently associated
with the stream had been used.

<...>

If the filename is a null pointer and the application does not comform to
SUSv3, freopen() returns a null pointer.


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
       [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2012-06-01 14:24 ` gseanmcg at gmail dot com
@ 2013-08-06  0:21 ` lionelcons1972 at gmail dot com
  11 siblings, 0 replies; 29+ messages in thread
From: lionelcons1972 at gmail dot com @ 2013-08-06  0:21 UTC (permalink / raw)
  To: gcc-bugs

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

Lionel Cons <lionelcons1972 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lionelcons1972 at gmail dot com

--- Comment #28 from Lionel Cons <lionelcons1972 at gmail dot com> ---
Any progress on this bug?


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (15 preceding siblings ...)
  2009-10-09 19:42 ` rguenth at gcc dot gnu dot org
@ 2009-11-20 17:53 ` ro at gcc dot gnu dot org
  16 siblings, 0 replies; 29+ messages in thread
From: ro at gcc dot gnu dot org @ 2009-11-20 17:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from ro at gcc dot gnu dot org  2009-11-20 17:53 -------
Mine.


-- 

ro at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ro at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-06-17 19:42:47         |2009-11-20 17:53:02
               date|                            |


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (14 preceding siblings ...)
  2009-10-09 19:38 ` heydowns at borg dot com
@ 2009-10-09 19:42 ` rguenth at gcc dot gnu dot org
  2009-11-20 17:53 ` ro at gcc dot gnu dot org
  16 siblings, 0 replies; 29+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-09 19:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from rguenth at gcc dot gnu dot org  2009-10-09 19:42 -------
Patches should be sent to gcc-patches@gcc.gnu.org with a changelog entry and
a note on how you tested the patch.


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (13 preceding siblings ...)
  2009-07-16 21:11 ` heydowns at borg dot com
@ 2009-10-09 19:38 ` heydowns at borg dot com
  2009-10-09 19:42 ` rguenth at gcc dot gnu dot org
  2009-11-20 17:53 ` ro at gcc dot gnu dot org
  16 siblings, 0 replies; 29+ messages in thread
From: heydowns at borg dot com @ 2009-10-09 19:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from heydowns at borg dot com  2009-10-09 19:38 -------
Ping - anyone able to comment on or integrate this patch please?
Thank you!


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (12 preceding siblings ...)
  2009-07-10 14:41 ` heydowns at borg dot com
@ 2009-07-16 21:11 ` heydowns at borg dot com
  2009-10-09 19:38 ` heydowns at borg dot com
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: heydowns at borg dot com @ 2009-07-16 21:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from heydowns at borg dot com  2009-07-16 21:11 -------
Created an attachment (id=18210)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18210&action=view)
Fix updated for gcc 4.4.0, link xpg6 for c++, and link xpg4 for gnu*

Updated patch against gcc 4.4.0.
Also add xpg6 for c++ and xpg4 for gnu* as discussed above (this is now easily
modified by changing the spec if someone who knows better can say what gnu*
should do).


-- 

heydowns at borg dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #18121|0                           |1
        is obsolete|                            |


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (11 preceding siblings ...)
  2009-07-04 16:46 ` ebotcazou at gcc dot gnu dot org
@ 2009-07-10 14:41 ` heydowns at borg dot com
  2009-07-16 21:11 ` heydowns at borg dot com
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: heydowns at borg dot com @ 2009-07-10 14:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from heydowns at borg dot com  2009-07-10 14:41 -------
Trying to give some answers to Joseph's questions in comment 9.

The best documentation I found on what, exactly, the various object files do is
actually the man pages for the Sun Studio compilers and the OpenSolaris source
code for values-*.c

Choice of values-xpg*.o and values-X*.o are someone independent, so I'm
splitting up the explanation.


First, values-xpg*.o:

Link Tool & Flags          Link Result            Comment
c89                        values-xpg4.o
c99                        values-xpg6.o
cc -xc99=all,no_lib        Neither                Default -xc99 option
                                                  c99 language features, 
                                                  no c99 library support
cc -xc99=all               values-xpg6.o          c99 lang feat. & lib support
cc -xc99=none              Neither                No c99 at all

So, values-xpg6.o clearly enables c99 behavior of system libraries where there
is a runtime difference.  It also enables the preference of XPG4 behavior over
XPG3 behavior (as below).

>From looking at the OpenSolaris source code for values-xpg4.o, it is stated
that linking in that object file enables "xpg4 mode for APIs which have
differing runtime behavior from xpg3 to xpg4".

Lastly, from man page 'standards', the only time "cc" is recommended as a
compiler (instead of c89 or c99, and thus not linking any of values-xpg*.o) is
when you want to conform to SVID3 or CAE XPG3. 

What is the runtime difference of xpg3 versus xpg4?  I really don't know -
maybe someone can help here.

But, back to Joseph's question, the inclusion values-xpg*.o does not seem to
deal with extensions to standard behavior; rather it does sound like it
controls the standard to which functions should conform. Based on this I am
leaning towards saying values-xpg4.o should be enabled for -std=gnu89.  I'd
appreciate comments in light of the above.  (please note that this would make
it non-trivial to link for xpg3 behavior).


values-X{c,a,t,s}.o are what seem to control how strict the implementation
follows the standard.  Currently gcc only ever uses values-X{a,c}.o which is
probably sufficient, and I don't think that this needs to change at all:

-std=gnu*   -> values-Xa.o
otherwise   -> values-Xc.o

values-Xa is described as "ANSI conforming mode" whereas -Xc is "Strict ANSI
mode" in the Open Solaris sources. 

The 'cc' man page documents -Xa as ISO C plus K&R C compatibility extensions,
plus semantic changes required by ISO C, preferring ISO C semantics where there
is conflict.
-Xc is documented as "Strictly conforming" ISO C, no K&R extensions.


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (10 preceding siblings ...)
  2009-07-04 15:03 ` heydowns at borg dot com
@ 2009-07-04 16:46 ` ebotcazou at gcc dot gnu dot org
  2009-07-10 14:41 ` heydowns at borg dot com
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2009-07-04 16:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ebotcazou at gcc dot gnu dot org  2009-07-04 16:46 -------
> As far as I could tell from the documentation available to me, values-xpg4
> didn't exist until Solaris 2.6.  Based on the file names I was thinking
> sol2-6.h was for 2.6 and above, where sol2.h had to work for 2.5, etc.

sol2.h is for all versions of Solaris, sol2-6.h was for 2.6 and below.

> I can adjust it and try it with 4.4, but do we need to be concerned with
> Solaris < 2.6?

Support for 2.6 and below was removed in GCC 4.4 so we indeed don't care, you
only need to patch sol2.h and sol2-10.h.

> I will also try to research and adjust for Joseph's questions/comments on
> std=gnu* and c++.

Thanks in advance.


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (9 preceding siblings ...)
  2009-07-04 11:49 ` joseph at codesourcery dot com
@ 2009-07-04 15:03 ` heydowns at borg dot com
  2009-07-04 16:46 ` ebotcazou at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: heydowns at borg dot com @ 2009-07-04 15:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from heydowns at borg dot com  2009-07-04 15:03 -------
"sol2-6.h doesn't exist anymore in GCC 4.4 and later.  Since the patch won't be
applied to GCC 4.3.x, it must be adjusted.  Why was values-xpg4 only added to
sol2-6.h and not to sol2.h?"

As far as I could tell from the documentation available to me, values-xpg4
didn't exist until Solaris 2.6.  Based on the file names I was thinking
sol2-6.h was for 2.6 and above, where sol2.h had to work for 2.5, etc.

I can adjust it and try it with 4.4, but do we need to be concerned with
Solaris < 2.6?

I will also try to research and adjust for Joseph's questions/comments on
std=gnu* and c++.


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (8 preceding siblings ...)
  2009-07-04  7:57 ` ebotcazou at gcc dot gnu dot org
@ 2009-07-04 11:49 ` joseph at codesourcery dot com
  2009-07-04 15:03 ` heydowns at borg dot com
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: joseph at codesourcery dot com @ 2009-07-04 11:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from joseph at codesourcery dot com  2009-07-04 11:49 -------
Subject: Re:  -std=c99 does not enable c99 mode in Solaris
 C library

On Sat, 4 Jul 2009, ebotcazou at gcc dot gnu dot org wrote:

> > I wasn't sure exactly how to handle the various -std=gnu* modes, so I left
> > those as they were. 
> 
> Joseph, any recommendations about that?

I don't know what the exact effects of linking in these various objects 
are; whether they select between C90 and C99 behavior where those 
standards specify conflicting semantics for the same function, or disable 
Solaris extensions that conflict with the standards, or something else.  
If it's only selecting between the standards where they conflict, then 
gnu99/gnu9x should select C99, but gnu99/gnu9x should not generally 
disable extensions.

C++ options for C++0x / GNU-extended C++0x (-std=c++0x, -std=gnu++0x) 
should probably be treated like those for c99/gnu99, since C++0x uses the 
C99 library (whereas C++98/C++03 uses the C90+AMD1 library).


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (7 preceding siblings ...)
  2009-07-02 14:46 ` heydowns at borg dot com
@ 2009-07-04  7:57 ` ebotcazou at gcc dot gnu dot org
  2009-07-04 11:49 ` joseph at codesourcery dot com
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2009-07-04  7:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ebotcazou at gcc dot gnu dot org  2009-07-04 07:57 -------
> Attaching a fix that works here for Solaris 10 and I think would work for
> other Solaris versions.

Thanks.

> It changes the spec to account for the other options mentioned in comment 3,
> to handle the main issue of the bug (link values-xpg6.o in c99 mode), and
> also adds linking of values-xpg4.o as the Solaris manual suggests should be 
> done.

sol2-6.h doesn't exist anymore in GCC 4.4 and later.  Since the patch won't be
applied to GCC 4.3.x, it must be adjusted.  Why was values-xpg4 only added to
sol2-6.h and not to sol2.h?

> I wasn't sure exactly how to handle the various -std=gnu* modes, so I left
> those as they were. 

Joseph, any recommendations about that?

> To enable matching on ':' in std=iso9899:xxxx, I had to augment the spec
> language, as suggested in comment 6.  I realize you might want to treat this
> as a separate issue -- I can open a separate issue for this if you want.

The combined patch is fine I think.


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (6 preceding siblings ...)
  2009-06-18 21:49 ` joseph at codesourcery dot com
@ 2009-07-02 14:46 ` heydowns at borg dot com
  2009-07-04  7:57 ` ebotcazou at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: heydowns at borg dot com @ 2009-07-02 14:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from heydowns at borg dot com  2009-07-02 14:46 -------
Created an attachment (id=18121)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18121&action=view)
Proposed fix: Changes linking on solaris based on std=X and implements escapes
in braced specs

Attaching a fix that works here for Solaris 10 and I think would work for other
Solaris versions.
It changes the spec to account for the other options mentioned in comment 3, to
handle the main issue of the bug (link values-xpg6.o in c99 mode), and also
adds linking of values-xpg4.o as the Solaris manual suggests should be done.
I wasn't sure exactly how to handle the various -std=gnu* modes, so I left
those as they were. 

To enable matching on ':' in std=iso9899:xxxx, I had to augment the spec
language, as suggested in comment 6.  I realize you might want to treat this as
a separate issue -- I can open a separate issue for this if you want.


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (5 preceding siblings ...)
  2009-06-18 21:26 ` heydowns at borg dot com
@ 2009-06-18 21:49 ` joseph at codesourcery dot com
  2009-07-02 14:46 ` heydowns at borg dot com
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: joseph at codesourcery dot com @ 2009-06-18 21:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from joseph at codesourcery dot com  2009-06-18 21:49 -------
Subject: Re:  -std=c99 does not enable c99 mode in Solaris
 C library

On Thu, 18 Jun 2009, heydowns at borg dot com wrote:

> Was looking at modifying the spec to produce the desired results and contribute
> patch, however ran into trouble trying to match options containing literal
> colons (-std=iso9899:199409) in %{S:X} style spec.
> 
> Is there a way in the spec language to escape colons?  I briefly scanned the
> spec parsing code and nothing jumped out.
> 
> If not, is there some other way to match options containing colons (without
> using greedy * matches, since the part after the colon is significant here...)

You may well need to add a new feature to the specs parsing code to deal 
with this.

I have some ideas about how option handling, multilib handling and some 
aspects of specs should be redesigned, but this issue should not need any 
redesign.


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (4 preceding siblings ...)
  2009-06-17 19:43 ` rguenth at gcc dot gnu dot org
@ 2009-06-18 21:26 ` heydowns at borg dot com
  2009-06-18 21:49 ` joseph at codesourcery dot com
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: heydowns at borg dot com @ 2009-06-18 21:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from heydowns at borg dot com  2009-06-18 21:26 -------
Was looking at modifying the spec to produce the desired results and contribute
patch, however ran into trouble trying to match options containing literal
colons (-std=iso9899:199409) in %{S:X} style spec.

Is there a way in the spec language to escape colons?  I briefly scanned the
spec parsing code and nothing jumped out.

If not, is there some other way to match options containing colons (without
using greedy * matches, since the part after the colon is significant here...)


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (3 preceding siblings ...)
  2009-06-17 16:40 ` heydowns at borg dot com
@ 2009-06-17 19:43 ` rguenth at gcc dot gnu dot org
  2009-06-18 21:26 ` heydowns at borg dot com
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-06-17 19:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-06-17 19:42:47
               date|                            |


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
                   ` (2 preceding siblings ...)
  2009-06-17 15:34 ` joseph at codesourcery dot com
@ 2009-06-17 16:40 ` heydowns at borg dot com
  2009-06-17 19:43 ` rguenth at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: heydowns at borg dot com @ 2009-06-17 16:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from heydowns at borg dot com  2009-06-17 16:39 -------
Also observed on gcc 4.3.3


-- 

heydowns at borg dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.4.6                       |4.3.3


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
  2009-06-17 15:13 ` [Bug target/40411] " heydowns at borg dot com
  2009-06-17 15:24 ` rguenth at gcc dot gnu dot org
@ 2009-06-17 15:34 ` joseph at codesourcery dot com
  2009-06-17 16:40 ` heydowns at borg dot com
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: joseph at codesourcery dot com @ 2009-06-17 15:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from joseph at codesourcery dot com  2009-06-17 15:34 -------
Subject: Re:  -std=c99 does not enable c99 mode in Solaris
 C library

On Wed, 17 Jun 2009, rguenth at gcc dot gnu dot org wrote:

> GCC 3.4.x is no longer maintained, please check GCC 4.3.x or newer.

It is a matter of straightforward observation of the config/*.h and 
config/*/*.h files that these files are not linked in.  (That they should 
be linked in was noted on the Austin Group mailing list on 19 March 2005.)  
sol2.h links in values-Xc.o or values-Xa.o depending on -ansi, which 
itself is wrong because it doesn't allow for the other spellings of that 
option (-std=c89, -std=iso9899:1990, or -std=iso9899:199409 for C90 AMD1).


-- 


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
  2009-06-17 15:13 ` [Bug target/40411] " heydowns at borg dot com
@ 2009-06-17 15:24 ` rguenth at gcc dot gnu dot org
  2009-06-17 15:34 ` joseph at codesourcery dot com
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-06-17 15:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-06-17 15:24 -------
GCC 3.4.x is no longer maintained, please check GCC 4.3.x or newer.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library
  2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
@ 2009-06-17 15:13 ` heydowns at borg dot com
  2009-06-17 15:24 ` rguenth at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: heydowns at borg dot com @ 2009-06-17 15:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from heydowns at borg dot com  2009-06-17 15:13 -------
This also applies to Solaris x86.

Additionally, this only applies to Solaris 10 and later. Earlier versions of
Solaris did not ship c99-compliant C library and thus do not have the
values-xpg6.o object file for enabling c99-compliance.


-- 

heydowns at borg dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|sparc-sun-solaris2.10       |*-solaris2.10
   GCC host triplet|sparc-sun-solaris2.10       |*-solaris2.10
 GCC target triplet|sparc-sun-solaris2.10       |*-solaris2.10


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


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

end of thread, other threads:[~2013-08-06  0:21 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-40411-4@http.gcc.gnu.org/bugzilla/>
2010-12-26 18:06 ` [Bug target/40411] -std=c99 does not enable c99 mode in Solaris C library bruno at clisp dot org
2010-12-26 18:36 ` paolo.carlini at oracle dot com
2010-12-26 21:52 ` redi at gcc dot gnu.org
2010-12-27 19:17 ` pogma at gcc dot gnu.org
2011-01-04 18:11 ` gseanmcg at gmail dot com
2011-01-05 21:14 ` gseanmcg at gmail dot com
2011-03-07 20:16 ` gseanmcg at gmail dot com
2011-11-25 16:33 ` gseanmcg at gmail dot com
2011-11-25 17:18 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-11-25 17:24 ` joseph at codesourcery dot com
2012-06-01 14:24 ` gseanmcg at gmail dot com
2013-08-06  0:21 ` lionelcons1972 at gmail dot com
2009-06-10 22:44 [Bug c/40411] New: " heydowns at borg dot com
2009-06-17 15:13 ` [Bug target/40411] " heydowns at borg dot com
2009-06-17 15:24 ` rguenth at gcc dot gnu dot org
2009-06-17 15:34 ` joseph at codesourcery dot com
2009-06-17 16:40 ` heydowns at borg dot com
2009-06-17 19:43 ` rguenth at gcc dot gnu dot org
2009-06-18 21:26 ` heydowns at borg dot com
2009-06-18 21:49 ` joseph at codesourcery dot com
2009-07-02 14:46 ` heydowns at borg dot com
2009-07-04  7:57 ` ebotcazou at gcc dot gnu dot org
2009-07-04 11:49 ` joseph at codesourcery dot com
2009-07-04 15:03 ` heydowns at borg dot com
2009-07-04 16:46 ` ebotcazou at gcc dot gnu dot org
2009-07-10 14:41 ` heydowns at borg dot com
2009-07-16 21:11 ` heydowns at borg dot com
2009-10-09 19:38 ` heydowns at borg dot com
2009-10-09 19:42 ` rguenth at gcc dot gnu dot org
2009-11-20 17:53 ` ro at gcc dot gnu dot org

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).