Error in Sun studio 12's sysent.h ? - Solaris

This is a discussion on Error in Sun studio 12's sysent.h ? - Solaris ; I'm trying to compile wXwidgets 2.6.4 using Solaris Express Developer Edition and the Sun compilers - not gcc. bash-3.00$ cat /etc/release Solaris Express Developer Edition 9/07 snv_70b X86 Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. Use is subject to ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 23

Thread: Error in Sun studio 12's sysent.h ?

  1. Error in Sun studio 12's sysent.h ?

    I'm trying to compile wXwidgets 2.6.4 using Solaris Express Developer
    Edition and the Sun compilers - not gcc.


    bash-3.00$ cat /etc/release
    Solaris Express Developer Edition 9/07 snv_70b X86
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 30 August 2007

    It configures OK, and compiles quite a bit, but eventually it bombs out
    with a compilation error - Only one of a set of overloaded functions can
    be extern "C".

    bash-3.00$ gmake

    /tmp/wxWidgets-2.6.4/bk-deps CC -c -o coredll_utils.o -D__WXMOTIF__
    -I./src/expat/lib -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0
    -KPIC -DPIC -Ilib/wx/include/motif-ansi-release-2.6 -I./include
    -I/usr/openwin/include -I/usr/dt/include -D_FILE_OFFSET_BITS=64
    -D_LARGE_FILES -O -features=tmplife -mt -D_REENTRANT ./src/motif/utils.cpp
    "/opt/SUNWspro/prod/include/CC/sysent.h", line 29: Error: Only one of a
    set of overloaded functions can be extern "C".
    1 Error(s) detected.

    Commenting out line 29 of /opt/SUNWspro/prod/include/CC/sysent.h allows
    it to proceed.

    Any ideas?

  2. Re: Error in Sun studio 12's sysent.h ?

    caveman wrote:
    > I'm trying to compile wXwidgets 2.6.4 using Solaris Express Developer
    > Edition and the Sun compilers - not gcc.
    >
    >
    > bash-3.00$ cat /etc/release
    > Solaris Express Developer Edition 9/07 snv_70b X86
    > Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    > Use is subject to license terms.
    > Assembled 30 August 2007
    >
    > It configures OK, and compiles quite a bit, but eventually it bombs out
    > with a compilation error - Only one of a set of overloaded functions can
    > be extern "C".
    >
    > bash-3.00$ gmake
    >
    > /tmp/wxWidgets-2.6.4/bk-deps CC -c -o coredll_utils.o -D__WXMOTIF__
    > -I./src/expat/lib -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0
    > -KPIC -DPIC -Ilib/wx/include/motif-ansi-release-2.6 -I./include
    > -I/usr/openwin/include -I/usr/dt/include -D_FILE_OFFSET_BITS=64
    > -D_LARGE_FILES -O -features=tmplife -mt -D_REENTRANT ./src/motif/utils.cpp
    > "/opt/SUNWspro/prod/include/CC/sysent.h", line 29: Error: Only one of a
    > set of overloaded functions can be extern "C".
    > 1 Error(s) detected.
    >
    > Commenting out line 29 of /opt/SUNWspro/prod/include/CC/sysent.h allows
    > it to proceed.
    >
    > Any ideas?


    Something that includes sysent.h has wrapped it with extern "C".

    --
    Ian Collins.

  3. Re: Error in Sun studio 12's sysent.h ?

    On Tue, 27 Nov 2007 09:01:48 +0000, caveman wrote:
    > I'm trying to compile wXwidgets 2.6.4 using Solaris Express Developer
    > Edition and the Sun compilers - not gcc.
    >
    >
    > bash-3.00$ cat /etc/release
    > Solaris Express Developer Edition 9/07 snv_70b X86
    > Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    > Use is subject to license terms.
    > Assembled 30 August 2007
    >
    > It configures OK, and compiles quite a bit, but eventually it bombs out
    > with a compilation error - Only one of a set of overloaded functions can
    > be extern "C".
    >
    > bash-3.00$ gmake
    >
    > /tmp/wxWidgets-2.6.4/bk-deps CC -c -o coredll_utils.o -D__WXMOTIF__
    > -I./src/expat/lib -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0
    > -KPIC -DPIC -Ilib/wx/include/motif-ansi-release-2.6 -I./include
    > -I/usr/openwin/include -I/usr/dt/include -D_FILE_OFFSET_BITS=64
    > -D_LARGE_FILES -O -features=tmplife -mt -D_REENTRANT ./src/motif/utils.cpp




    > "/opt/SUNWspro/prod/include/CC/sysent.h", line 29: Error: Only one of a
    > set of overloaded functions can be extern "C".
    > 1 Error(s) detected.
    >
    > Commenting out line 29 of /opt/SUNWspro/prod/include/CC/sysent.h allows
    > it to proceed.


    The compiler is seeing more than one declaration for sethostname, at
    least one of which is extern "C". Does wxWindows contain a broken
    declaration?

    Try generating the preprocessed file (with -E) to see the multiple
    declarations.

    A bientot
    Paul
    --
    Paul Floyd http://paulf.free.fr

  4. Re: Error in Sun studio 12's sysent.h ?

    Paul Floyd wrote:
    > On Tue, 27 Nov 2007 09:01:48 +0000, caveman wrote:
    >> I'm trying to compile wXwidgets 2.6.4 using Solaris Express Developer
    >> Edition and the Sun compilers - not gcc.
    >>
    >>
    >> bash-3.00$ cat /etc/release
    >> Solaris Express Developer Edition 9/07 snv_70b X86
    >> Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    >> Use is subject to license terms.
    >> Assembled 30 August 2007
    >>
    >> It configures OK, and compiles quite a bit, but eventually it bombs out
    >> with a compilation error - Only one of a set of overloaded functions can
    >> be extern "C".
    >>
    >> bash-3.00$ gmake
    >>
    >> /tmp/wxWidgets-2.6.4/bk-deps CC -c -o coredll_utils.o -D__WXMOTIF__
    >> -I./src/expat/lib -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0
    >> -KPIC -DPIC -Ilib/wx/include/motif-ansi-release-2.6 -I./include
    >> -I/usr/openwin/include -I/usr/dt/include -D_FILE_OFFSET_BITS=64
    >> -D_LARGE_FILES -O -features=tmplife -mt -D_REENTRANT ./src/motif/utils.cpp

    >
    >
    >
    >> "/opt/SUNWspro/prod/include/CC/sysent.h", line 29: Error: Only one of a
    >> set of overloaded functions can be extern "C".
    >> 1 Error(s) detected.
    >>
    >> Commenting out line 29 of /opt/SUNWspro/prod/include/CC/sysent.h allows
    >> it to proceed.

    >
    > The compiler is seeing more than one declaration for sethostname, at
    > least one of which is extern "C". Does wxWindows contain a broken
    > declaration?
    >
    > Try generating the preprocessed file (with -E) to see the multiple
    > declarations.
    >
    > A bientot
    > Paul


    Thanks. I tried compiling with the -E switch and grepping the output for
    sethostname. Sure enough 'sethostname' is defined twice - not the same
    way either.



    bash-3.00$ /tmp/wxWidgets-2.6.4/bk-deps CC -E -D__WXMOTIF__
    -I./src/expat/lib -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0 -KPIC
    -DPIC -Ilib/wx/include/motif-ansi-release-2.6 -I./include
    -I/usr/openwin/include -I/usr/dt/include -D_FILE_OFFSET_BITS=64
    -D_LARGE_FILES -O -features=tmplife -mt -D_REENTRANT
    ../src/motif/utils.cpp | grep sethostname
    extern int sethostname ( char * , int ) ;
    extern int sethostname ( const char * , int ) ;


    Looking at the output from the preprocessor (over 35,000 lines), it
    would appear both /opt/SUNWspro/prod/include/CC/sysent.h and
    /usr/include/unistd.h get included. Both have sethostname defined in them.

    bash-3.00$ grep sethostname /usr/include/unistd.h
    extern int sethostname(char *, int);
    extern int sethostname();

    bash-3.00$ grep sethostname /opt/SUNWspro/prod/include/CC/sysent.h
    extern int sethostname(const char*, int);


    The C file causing the problem (./src/motif/utils.cpp) has this which
    obviously causes sysent.h to be included:

    #if (defined(__SUNCC__) || defined(__CLCC__))
    #include
    #endif

    but it must include a file which includes another file, which results in
    /usr/include/unistd.h being included, as I can't find where it is included.


    BTW, a grep for sethostname on the wxWidgets tar file returns nothing so
    the issue is one of including multiple Sun header files, rather than
    because a wxWidgets source file has any reference to sethostname.

  5. Re: Error in Sun studio 12's sysent.h ?

    caveman wrote:
    > Paul Floyd wrote:
    >>
    >> Try generating the preprocessed file (with -E) to see the multiple
    >> declarations.
    >>

    > Thanks. I tried compiling with the -E switch and grepping the output for
    > sethostname. Sure enough 'sethostname' is defined twice - not the same
    > way either.
    >
    >
    > Looking at the output from the preprocessor (over 35,000 lines), it
    > would appear both /opt/SUNWspro/prod/include/CC/sysent.h and
    > /usr/include/unistd.h get included. Both have sethostname defined in them.
    >
    > bash-3.00$ grep sethostname /usr/include/unistd.h
    > extern int sethostname(char *, int);
    > extern int sethostname();
    >
    > bash-3.00$ grep sethostname /opt/SUNWspro/prod/include/CC/sysent.h
    > extern int sethostname(const char*, int);
    >
    > The C file causing the problem (./src/motif/utils.cpp) has this which
    > obviously causes sysent.h to be included:
    >
    > #if (defined(__SUNCC__) || defined(__CLCC__))
    > #include
    > #endif
    >
    > but it must include a file which includes another file, which results in
    > /usr/include/unistd.h being included, as I can't find where it is included.
    >

    sysent.h includes unistd.h, so the compiler drive should define the
    correct macro to prevent both declaration being visible. Does the
    configure script add any -D or -U lines for the macros used in unistd.h
    to conditionally declare sethostname? I'd expect only the sysent.h
    declaration to be visible.

    --
    Ian Collins.

  6. Re: Error in Sun studio 12's sysent.h ?

    Ian Collins wrote:

    > sysent.h includes unistd.h, so the compiler drive should define the
    > correct macro to prevent both declaration being visible. Does the
    > configure script add any -D or -U lines for the macros used in unistd.h
    > to conditionally declare sethostname? I'd expect only the sysent.h
    > declaration to be visible.
    >


    IF I understand you correctly, then the answer is no.

    The word 'sethostname' does not appear anywhere in the wxWidgets source
    code, as a grep for sethostname on the tar file I downloaded does not
    show any output. That is hardly surprising given the nature of the
    program - it should not be trying to change the hostname.


    Dave (aka caveman)

  7. Re: Error in Sun studio 12's sysent.h ?

    On Nov 27, 1:01 am, caveman wrote:
    > I'm trying to compile wXwidgets 2.6.4 using Solaris Express Developer
    > Edition and the Sun compilers - not gcc.
    >
    > bash-3.00$ cat /etc/release
    > Solaris Express Developer Edition 9/07 snv_70b X86
    > Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    > Use is subject to license terms.
    > Assembled 30 August 2007
    >
    > It configures OK, and compiles quite a bit, but eventually it bombs out
    > with a compilation error - Only one of a set of overloaded functions can
    > be extern "C".
    >
    > bash-3.00$ gmake
    >
    > /tmp/wxWidgets-2.6.4/bk-deps CC -c -o coredll_utils.o -D__WXMOTIF__
    > -I./src/expat/lib -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0
    > -KPIC -DPIC -Ilib/wx/include/motif-ansi-release-2.6 -I./include
    > -I/usr/openwin/include -I/usr/dt/include -D_FILE_OFFSET_BITS=64
    > -D_LARGE_FILES -O -features=tmplife -mt -D_REENTRANT ./src/motif/utils.cpp
    > "/opt/SUNWspro/prod/include/CC/sysent.h", line 29: Error: Only one of a
    > set of overloaded functions can be extern "C".
    > 1 Error(s) detected.
    > Commenting out line 29 of /opt/SUNWspro/prod/include/CC/sysent.h allows
    > it to proceed.
    > Any ideas?


    This seems to compile OK on SPARC using Studio 12 but I had to
    tinker a bit with options. Heres an example:
    /src/spillover/wxWidgets-2.6.4/bk-deps CC -c -o coredll_utils.o -
    D__WXMOTIF__
    -I./src/expat/lib -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0 -KPIC
    -DPIC -Ilib/wx/include/motif-ansi-release-2.6 -I./include -I/usr/
    openwin/include -I/usr/dt/include -D_FILE_OFFSET_BITS=64 -
    D_LARGE_FILES -I/usr/openwin/include -O -features=tmplife -mt -
    D_REENTRANT -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT ./
    src/motif/utils.cpp

    Almost the same. I added SDL audio for a plugin. I think if you remove
    some --option
    like maybe "universal" it will compile fine. Hard to say as you never
    that info..


  8. Re: Error in Sun studio 12's sysent.h ?

    On Wed, 28 Nov 2007 07:40:50 +0000, caveman wrote:
    >
    > Looking at the output from the preprocessor (over 35,000 lines), it
    > would appear both /opt/SUNWspro/prod/include/CC/sysent.h and
    > /usr/include/unistd.h get included. Both have sethostname defined in them.
    >
    > bash-3.00$ grep sethostname /usr/include/unistd.h
    > extern int sethostname(char *, int);
    > extern int sethostname();
    >
    > bash-3.00$ grep sethostname /opt/SUNWspro/prod/include/CC/sysent.h
    > extern int sethostname(const char*, int);


    So it looks like the problem is between the system headers and the
    compiler's C++ headers. If you can, report it to Sun.

    You may be able to workaround the problem by using one of the XOPEN or
    POSIX defines.

    A bientot
    Paul
    --
    Paul Floyd http://paulf.free.fr

  9. Re: Error in Sun studio 12's sysent.h ?

    Paul Floyd wrote:
    > On Wed, 28 Nov 2007 07:40:50 +0000, caveman wrote:
    >> Looking at the output from the preprocessor (over 35,000 lines), it
    >> would appear both /opt/SUNWspro/prod/include/CC/sysent.h and
    >> /usr/include/unistd.h get included. Both have sethostname defined in them.
    >>
    >> bash-3.00$ grep sethostname /usr/include/unistd.h
    >> extern int sethostname(char *, int);
    >> extern int sethostname();
    >>
    >> bash-3.00$ grep sethostname /opt/SUNWspro/prod/include/CC/sysent.h
    >> extern int sethostname(const char*, int);

    >
    > So it looks like the problem is between the system headers and the
    > compiler's C++ headers. If you can, report it to Sun.


    I don't have a Sun contract, but I'm hoping someone here can suggest the
    best way to report this, or at least verify there is a problem.

    I have isolated it down to a 4-line program which gives the problem:

    #include
    #include
    int main() {
    }


    That is sufficient to generate a compilation error on Solaris Express
    Developer Edition 9/07 snv_70b X86, but not on a SPARC system. (Slightly
    different versions of Solaris 10 and compilers though).


    *** PROBLEM on Solaris 10 x86 Developer edition ***

    -bash-3.00$ cat /etc/release
    Solaris Express Developer Edition 9/07 snv_70b X86
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 30 August 2007
    -bash-3.00$ cat test.c
    #include
    #include
    int main() {
    }

    -bash-3.00$ /opt/SUNWspro/bin/CC test.c
    "/opt/SUNWspro/prod/include/CC/sysent.h", line 29: Error: Only one of a
    set of overloaded functions can be extern "C".
    1 Error(s) detected.
    -bash-3.00$ /opt/SUNWspro/bin/CC -V
    CC: Sun C++ 5.9 SunOS_i386 Build47_dlight 2007/05/22






    *** OK On Solaris 10 8/07 on SPARC ***


    kestrel /tmp % cat /etc/release
    Solaris 10 8/07 s10s_u4wos_12b SPARC
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 16 August 2007
    kestrel /tmp % cat cat test.c
    cat: cannot open cat
    #include
    #include
    #include
    #include
    int main() {
    }
    kestrel /tmp % /opt/SUNWspro/bin/CC test.c
    kestrel /tmp % /opt/SUNWspro/bin/CC -V
    CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25




    I believe that shows there is a problem. Anyone else care to comment,
    or suggest the best place to report this? I don't have a Sun contract.

  10. Re: Error in Sun studio 12's sysent.h ?

    Dave wrote:
    > Paul Floyd wrote:
    >> On Wed, 28 Nov 2007 07:40:50 +0000, caveman
    >> wrote:
    >>> Looking at the output from the preprocessor (over 35,000 lines), it
    >>> would appear both /opt/SUNWspro/prod/include/CC/sysent.h and
    >>> /usr/include/unistd.h get included. Both have sethostname defined in
    >>> them.
    >>>
    >>> bash-3.00$ grep sethostname /usr/include/unistd.h
    >>> extern int sethostname(char *, int);
    >>> extern int sethostname();
    >>>
    >>> bash-3.00$ grep sethostname /opt/SUNWspro/prod/include/CC/sysent.h
    >>> extern int sethostname(const char*, int);

    >>
    >> So it looks like the problem is between the system headers and the
    >> compiler's C++ headers. If you can, report it to Sun.

    >
    > I don't have a Sun contract, but I'm hoping someone here can suggest the
    > best way to report this, or at least verify there is a problem.
    >
    > I have isolated it down to a 4-line program which gives the problem:
    >
    > #include
    > #include
    > int main() {
    > }
    >
    >
    > That is sufficient to generate a compilation error on Solaris Express
    > Developer Edition 9/07 snv_70b X86, but not on a SPARC system. (Slightly
    > different versions of Solaris 10 and compilers though).
    >
    >
    > *** PROBLEM on Solaris 10 x86 Developer edition ***
    >
    > -bash-3.00$ cat /etc/release
    > Solaris Express Developer Edition 9/07 snv_70b X86
    > Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    > Use is subject to license terms.
    > Assembled 30 August 2007
    > -bash-3.00$ cat test.c
    > #include
    > #include
    > int main() {
    > }
    >
    > -bash-3.00$ /opt/SUNWspro/bin/CC test.c
    > "/opt/SUNWspro/prod/include/CC/sysent.h", line 29: Error: Only one of a
    > set of overloaded functions can be extern "C".
    > 1 Error(s) detected.
    > -bash-3.00$ /opt/SUNWspro/bin/CC -V
    > CC: Sun C++ 5.9 SunOS_i386 Build47_dlight 2007/05/22
    >
    >
    >
    >
    >
    >
    > *** OK On Solaris 10 8/07 on SPARC ***


    What I posted on SPARC was not quite the same as on the x86, see correction

    kestrel /tmp % cat /etc/release
    Solaris 10 8/07 s10s_u4wos_12b SPARC
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 16 August 2007
    kestrel /tmp % cat test.c
    #include
    #include
    int main() {
    }
    kestrel /tmp % /opt/SUNWspro/bin/CC test.c
    kestrel /tmp % /opt/SUNWspro/bin/CC -V
    CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25


    That compiles fine on SPARC, but not on the x86 system.


    line 29 of /opt/SUNWspro/prod/include/CC/sysent.h, which is the line
    causing the hassle on x86, says:

    extern int sethostname(const char*, int);


    Dave


  11. Re: Error in Sun studio 12's sysent.h ?

    Dave writes:

    > What I posted on SPARC was not quite the same as on the x86, see correction
    >
    > kestrel /tmp % cat /etc/release
    > Solaris 10 8/07 s10s_u4wos_12b SPARC
    > Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    > Use is subject to license terms.
    > Assembled 16 August 2007
    > kestrel /tmp % cat test.c
    > #include
    > #include
    > int main() {
    > }
    > kestrel /tmp % /opt/SUNWspro/bin/CC test.c
    > kestrel /tmp % /opt/SUNWspro/bin/CC -V
    > CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
    >
    >
    > That compiles fine on SPARC, but not on the x86 system.


    sha@kelvin /var/tmp $ cat test.c
    #include
    #include
    int main() {
    }

    sha@kelvin /var/tmp $ CC test.c
    sha@kelvin /var/tmp $ CC -V
    CC: Sun C++ 5.9 SunOS_i386 Patch 124864-01 2007/07/25

    Compiles without errors, system is a Sun Fire X4100 (dual Athlon, 64 bit)


    Sebastian

  12. Re: Error in Sun studio 12's sysent.h ?

    Sebastian Hanigk wrote:

    >> That compiles fine on SPARC, but not on the x86 system.

    >
    > sha@kelvin /var/tmp $ cat test.c
    > #include
    > #include
    > int main() {
    > }
    >
    > sha@kelvin /var/tmp $ CC test.c
    > sha@kelvin /var/tmp $ CC -V
    > CC: Sun C++ 5.9 SunOS_i386 Patch 124864-01 2007/07/25
    >
    > Compiles without errors, system is a Sun Fire X4100 (dual Athlon, 64 bit)
    >
    >
    > Sebastian


    What version of Solaris though? I'm using the Solaris Express Developer
    Edition, which was installed on a Sony laptop from a DVD sent to me by Sun.


    -bash-3.00$ cat /etc/release
    Solaris Express Developer Edition 9/07 snv_70b X86
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 30 August 2007

    It works fine on my SPARC box which is the standard release of Solaris
    10 update 4, and not Solaris Express.

    Anyone care to try to compile that program on the latest Solaris Express
    Developer edition?

  13. Re: Error in Sun studio 12's sysent.h ?

    On Nov 30, 5:28 am, Dave wrote:
    > Sebastian Hanigk wrote:
    > >> That compiles fine on SPARC, but not on the x86 system.

    >
    > > sha@kelvin /var/tmp $ cat test.c
    > > #include
    > > #include
    > > int main() {
    > > }

    >
    > > sha@kelvin /var/tmp $ CC test.c
    > > sha@kelvin /var/tmp $ CC -V
    > > CC: Sun C++ 5.9 SunOS_i386 Patch 124864-01 2007/07/25

    >
    > > Compiles without errors, system is a Sun Fire X4100 (dual Athlon, 64 bit)

    >
    > > Sebastian

    >
    > What version of Solaris though? I'm using the Solaris Express Developer
    > Edition, which was installed on a Sony laptop from a DVD sent to me by Sun.


    I think we need to get Studio 12 patched up somehow.
    Header files seem to be different on the SPARC version??

    > It works fine on my SPARC box which is the standard release of Solaris
    > 10 update 4, and not Solaris Express.
    > Anyone care to try to compile that program on the latest Solaris Express
    > Developer edition?


    I get an overload error using CC on b70b Express..
    CC -V sez: C+= 5.9 Build47_dlight

    You can report bugs on the OpenSolaris.org site.
    Exactly where I do not know

  14. Re: Error in Sun studio 12's sysent.h ?

    gerryt wrote:

    >> Anyone care to try to compile that program on the latest Solaris Express
    >> Developer edition?

    >
    > I get an overload error using CC on b70b Express..
    > CC -V sez: C+= 5.9 Build47_dlight
    >
    > You can report bugs on the OpenSolaris.org site.
    > Exactly where I do not know



    I reported this under the title 'A 4 line C program including both
    unistd.h and sysent.h will not compile.' on the OpenSolaris web site.
    Although the web page gave confirmation the bug was submitted, I was not
    given any bug ID.

    I don't know enough about compilers to have much hope of fixing this
    myself, but hopefully the fact that two of us can reproduce it with a C
    file that is only 4 lines long, should make it fairly easy a
    knowledgeable person to reproduce and fix.


  15. Re: Error in Sun studio 12's sysent.h ?

    On Nov 30, 7:29 am, Dave wrote:
    > gerryt wrote:
    > >> Anyone care to try to compile that program on the latest Solaris Express
    > >> Developer edition?

    > > I get an overload error using CC on b70b Express..
    > > CC -V sez: C+= 5.9 Build47_dlight
    > > You can report bugs on the OpenSolaris.org site.
    > > Exactly where I do not know

    > I reported this under the title 'A 4 line C program including both
    > unistd.h and sysent.h will not compile.' on the OpenSolaris web site.
    > Although the web page gave confirmation the bug was submitted, I was not
    > given any bug ID.


    You might yet.

    > I don't know enough about compilers to have much hope of fixing this
    > myself, but hopefully the fact that two of us can reproduce it with a C
    > file that is only 4 lines long, should make it fairly easy a
    > knowledgeable person to reproduce and fix.


    I hope its a typo in the header files in question. Do a diff on the
    SPARC vs
    Wintel versions and see. CC thinks something is declared twice so I'd
    start there
    If that aint it then things get much more complicated

  16. Re: Error in Sun studio 12's sysent.h ?

    Dave wrote:
    > gerryt wrote:
    >
    >>> Anyone care to try to compile that program on the latest Solaris Express
    >>> Developer edition?

    >>
    >> I get an overload error using CC on b70b Express..
    >> CC -V sez: C+= 5.9 Build47_dlight
    >>
    >> You can report bugs on the OpenSolaris.org site.
    >> Exactly where I do not know

    >
    >
    > I reported this under the title 'A 4 line C program including both
    > unistd.h and sysent.h will not compile.' on the OpenSolaris web site.
    > Although the web page gave confirmation the bug was submitted, I was not
    > given any bug ID.
    >
    > I don't know enough about compilers to have much hope of fixing this
    > myself, but hopefully the fact that two of us can reproduce it with a C
    > file that is only 4 lines long, should make it fairly easy a
    > knowledgeable person to reproduce and fix.
    >


    Sorry if I jump in here, not being to much up to date on coding anymore,
    but can't it be that there is a mismatch in what the compiler think the
    code is, c or C++ ??? I mean, as the code is now (the 4 lines) it's just
    plain c to me. But I might be way off on this one... Maybe C++ can look
    just like c.


    thommym@schumi:~/test/c$ cc -o test-error test-error.c
    "test-error.c", line 2: cannot find include file:
    cc: acomp failed for test-error.c


    thommym@schumi:~/test/c$ CC -o test-error test-error.c
    "/opt/SUNWspro/prod/include/CC/sysent.h", line 29: Error: Only one of a
    set of overloaded functions can be extern "C".
    1 Error(s) detected.


    thommym@schumi:~/test/c$ cc -V
    cc: Sun C 5.9 SunOS_i386 2007/05/03

    thommym@schumi:~/test/c$ CC -V
    CC: Sun C++ 5.9 SunOS_i386 2007/05/03
    thommym@schumi:~/test/c$

    thommym@schumi:~/test/c$ cat /etc/release
    Solaris Express Community Edition snv_76 X86
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 26 October 2007

  17. Re: Error in Sun studio 12's sysent.h ?

    gerryt wrote:
    > On Nov 30, 7:29 am, Dave wrote:
    >> gerryt wrote:
    >>>> Anyone care to try to compile that program on the latest Solaris Express
    >>>> Developer edition?
    >>> I get an overload error using CC on b70b Express..
    >>> CC -V sez: C+= 5.9 Build47_dlight
    >>> You can report bugs on the OpenSolaris.org site.
    >>> Exactly where I do not know

    >> I reported this under the title 'A 4 line C program including both
    >> unistd.h and sysent.h will not compile.' on the OpenSolaris web site.
    >> Although the web page gave confirmation the bug was submitted, I was not
    >> given any bug ID.

    >
    > You might yet.
    >
    >> I don't know enough about compilers to have much hope of fixing this
    >> myself, but hopefully the fact that two of us can reproduce it with a C
    >> file that is only 4 lines long, should make it fairly easy a
    >> knowledgeable person to reproduce and fix.

    >
    > I hope its a typo in the header files in question. Do a diff on the
    > SPARC vs
    > Wintel versions and see. CC thinks something is declared twice so I'd
    > start there
    > If that aint it then things get much more complicated


    It is that - the header file /usr/include/unistd.h is different between
    the SPARC and x86. But its not so obvious which one is correct.

    The SPARC version of /usr/include/unistd.h (from Solaris 10 update 4
    08/07) does not define sethostname() at all. But the sethostname(3c) man
    page says its defined in unistd.h. So I would conclude the SPARC header
    is not consistant with the man page.

    The x86 version of the file defines sethostname twice.

    bash-3.00$ grep sethostname /usr/include/unistd.h
    extern int sethostname(char *, int);
    extern int sethostname();

    But its the x86 header file which is presenting me the problem.

    Probably relavant is this bug

    http://bugs.opensolaris.org/view_bug.do?bug_id=6438052

    with the title "sethostname(3c) missing prototype in unistd.h"

    That bug says was not defined in unistd.h. But it would appear it has
    been defined in the x86 version but not the SPARC version. This bug is
    from July 2006 and was supposidly fixed in snv_44 according to that.

    So it seems there are some 'issues' on /usr/include/unistd.h.


  18. Re: Error in Sun studio 12's sysent.h ?

    Dave writes:

    > What version of Solaris though? I'm using the Solaris Express
    > Developer Edition, which was installed on a Sony laptop from a DVD
    > sent to me by Sun.


    sha@kelvin ~ $ cat /etc/release
    Solaris 10 8/07 s10x_u4wos_12b X86
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 16 August 2007


    It seems that it's a problem with the developer releases, the server
    with which I've tested it runs the latest Solaris 10 update.


    Sebastian

  19. Re: Error in Sun studio 12's sysent.h ?

    Sebastian Hanigk wrote:
    > Dave writes:
    >
    >> What version of Solaris though? I'm using the Solaris Express
    >> Developer Edition, which was installed on a Sony laptop from a DVD
    >> sent to me by Sun.

    >
    > sha@kelvin ~ $ cat /etc/release
    > Solaris 10 8/07 s10x_u4wos_12b X86
    > Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    > Use is subject to license terms.
    > Assembled 16 August 2007
    >
    >
    > It seems that it's a problem with the developer releases, the server
    > with which I've tested it runs the latest Solaris 10 update.
    >
    >
    > Sebastian



    But I think the header on the non-developer one is at fault too.




    man sethostname

    Standard C Library Functions gethostname(3C)

    NAME
    gethostname, sethostname - get or set name of current host

    SYNOPSIS
    #include

    int gethostname(char *name, int namelen);

    int sethostname(char *name, int namelen);



    but on a SPARC



    kestrel / % cat /etc/release
    Solaris 10 8/07 s10s_u4wos_12b SPARC
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 16 August 2007


    kestrel / % grep sethostname /usr/include/unistd.h



    So despite what the man page says, sethostname is not declared in
    unistd.h on Solaris 10 update 4 on SPARC.





  20. Re: Error in Sun studio 12's sysent.h ?

    On Nov 30, 8:56 am, caveman wrote:
    > gerryt wrote:
    > > On Nov 30, 7:29 am, Dave wrote:
    > >> gerryt wrote:
    > >>>> Anyone care to try to compile that program on the latest Solaris Express
    > >>>> Developer edition?
    > >>> I get an overload error using CC on b70b Express..
    > >>> CC -V sez: C+= 5.9 Build47_dlight
    > >>> You can report bugs on the OpenSolaris.org site.
    > >>> Exactly where I do not know
    > >> I reported this under the title 'A 4 line C program including both
    > >> unistd.h and sysent.h will not compile.' on the OpenSolaris web site.
    > >> Although the web page gave confirmation the bug was submitted, I was not
    > >> given any bug ID.

    >
    > > You might yet.

    >
    > >> I don't know enough about compilers to have much hope of fixing this
    > >> myself, but hopefully the fact that two of us can reproduce it with a C
    > >> file that is only 4 lines long, should make it fairly easy a
    > >> knowledgeable person to reproduce and fix.

    >
    > > I hope its a typo in the header files in question. Do a diff on the
    > > SPARC vs
    > > Wintel versions and see. CC thinks something is declared twice so I'd
    > > start there
    > > If that aint it then things get much more complicated

    >
    > It is that - the header file /usr/include/unistd.h is different between
    > the SPARC and x86. But its not so obvious which one is correct.
    >
    > The SPARC version of /usr/include/unistd.h (from Solaris 10 update 4
    > 08/07) does not define sethostname() at all. But the sethostname(3c) man
    > page says its defined in unistd.h. So I would conclude the SPARC header
    > is not consistant with the man page.
    >
    > The x86 version of the file defines sethostname twice.
    >
    > bash-3.00$ grep sethostname /usr/include/unistd.h
    > extern int sethostname(char *, int);
    > extern int sethostname();
    >
    > But its the x86 header file which is presenting me the problem.
    >
    > Probably relavant is this bug
    >
    > http://bugs.opensolaris.org/view_bug.do?bug_id=6438052
    >
    > with the title "sethostname(3c) missing prototype in unistd.h"
    >
    > That bug says was not defined in unistd.h. But it would appear it has
    > been defined in the x86 version but not the SPARC version. This bug is
    > from July 2006 and was supposidly fixed in snv_44 according to that.
    >
    > So it seems there are some 'issues' on /usr/include/unistd.h.


    unistd.h should have the define. Its missing. If you add it to SPARC
    you get the same error as x86. The fault for me lies in
    /opt/SUNWspro/prod/include/CC/sysent.h which redefines sethostname
    as a "const"... Its a prototype clash.
    Remove the const and all is well. Whats const for here anyway??

    There may be some C++ reason for setting const here (this week). Youd
    have to
    ask in comp.lang.c++ My Stroustrup book is very old but states that in
    C++
    a const should be initialized to some value, but the example refers
    to a variable not a library function..
    One of the many reasons I find OO languages a pile of horse feathers..

+ Reply to Thread
Page 1 of 2 1 2 LastLast