Bug 5354 - Compilation with solaris 10 and studio 12 need "-xc99" to include stdbool.h
Summary: Compilation with solaris 10 and studio 12 need "-xc99" to include stdbool.h
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.2.0
Hardware: Sparc Solaris
: P3 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-26 10:57 UTC by Nicolas Dorfsman (mail address dead)
Modified: 2009-11-07 14:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Dorfsman (mail address dead) 2008-03-26 10:57:43 UTC
I found some bug items on SunSolve. None of them are really clear though.

Compilation failed with :
"/usr/include/stdbool.h", line 42: #error: "Use of <stdbool.h> is valid only in a c99 compilation environment."

I added "-xc99" to CFLAGS.

extract from the cc man :
     -xc99[=o]
          The -xc99 flag controls compiler recognition of the
          implemented features from the C99 standard (ISO/IEC
          9899:1999, Programming Language - C).

          o can be a comma separated list comprised of the fol-
          lowing:

          Value          Meaning

          [no]_lib       [Do not] Enable the 1999 C standard
                         library semantics of routines that
                         appeared in both the 1990 and 1999 C
                         standard.

          all            Turn on recognition of supported C99
                         language features and enable the 1999 C
                         standard library semantics of routines
                         that appear in both the 1990 and 1999 C
                         standard.

          none           Turn off recognition of C99 language
                         features, and do not enable the 1999 C
                         standard library semantics of routines
                         that appeared in both the 1990 and 1999
                         C standard.

          If you do not specify -xc99, the compiler defaults to
          -xc99=all,no_lib.
          If you specify -xc99 without any values, the option is
          set to -xc99=all.


(cc: Sun C 5.9 SunOS_sparc Patch 124867-02 2007/11/27)

Nicolas
Comment 1 Nicolas Dorfsman (mail address dead) 2008-08-05 04:03:22 UTC
Could somebody tell me which file I have to modify to fix this bug ?
Comment 2 Gerald (Jerry) Carter (dead mail address) 2008-08-05 09:20:43 UTC
(In reply to comment #1)
> Could somebody tell me which file I have to modify to fix this bug ?
> 

You mean how to automatically add -xc99 to the CFLAGS when configure
detects the Sun compiler?
Comment 3 Nicolas Dorfsman (mail address dead) 2008-08-05 09:25:02 UTC
(In reply to comment #2)
> > Could somebody tell me which file I have to modify to fix this bug ?
> >  
> You mean how to automatically add -xc99 to the CFLAGS when configure
> detects the Sun compiler?

Definitively.

Comment 4 Björn Jacke 2009-11-07 14:29:32 UTC
we have several machines which build samba on sparc with the sun studio compiler. if this bug still is valid for you with samba 3.4.3 or later please reopen and attach the config.log produced by configure.