typeof support on Solaris with Sun Studio?

Am I mistaken or is typeof support only available on the Linux edition of Sun Studio Express?
[100 byte] By [c_chana] at [2007-11-27 1:16:48]
# 1
typeof extension is supported on Solaris as well as on Linux.
dmikha at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Is there a flag that I must use to turn it on?
c_chana at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
No flag is necessary. It is accepted by default in Sun Studio 12 EA.
ddpa at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
oh...i take it then that Sun Studio Express 4 (april 2007) is not sun studio 12 EA?
c_chana at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
i mean sun studio express february build...anyway...the same as 12 ea i see.
c_chana at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
sun studio express february build cc cannot process typeof under solaris. it can under linux.
c_chana at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7
Whats your problem with typeof?By default it should work both on Linux and Solaris.Supplying testcase and compilation options would help.regards,__Fedor.
SFVa at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 8
download asterisk 1.4.2 and try to compile it. After removing -Wall from the commandline options in the Makefile for subdirectory menuselect, it will be unable to compile menuselect.c under Solaris but will under Linux.source:
c_chana at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 9

Works for me on Solaris 11 x86.

Did simple ./configure with cc/CC pointing out to suncc/sunCC and then gmake:

...

suncc-o menuselect.o -g -c -D_GNU_SOURCE menuselect.c

"menuselect.c", line 472: warning: implicit function declaration: strsep

"menuselect.c", line 747: warning: improper pointer/integer combination: op "="

"menuselect.c", line 748: warning: improper pointer/integer combination: op "="

"menuselect.c", line 809: warning: improper pointer/integer combination: op "="

"menuselect.c", line 822: warning: improper pointer/integer combination: op "="

"menuselect.c", line 935: warning: implicit function declaration: ast_strdupa

"menuselect.c", line 935: warning: improper pointer/integer combination: op "="

"menuselect.c", line 935: warning: improper pointer/integer combination: op "="

"menuselect.c", line 937: warning: improper pointer/integer combination: op "="

"menuselect.c", line 945: warning: improper pointer/integer combination: op "="

"menuselect.c", line 945: warning: improper pointer/integer combination: op "="

"menuselect.c", line 947: warning: improper pointer/integer combination: op "="

It fails later on (misconfigured - absent include file) menuselect/strcompat.c

regards,

__Fedor.

SFVa at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 10

CC=/home/chris/SUNWspro/bin/cc CXX=/home/chris/SUNWspro/bin/CC ./configure --prefix=/opt/asterisk

-bash-3.00$ gmake

gmake[1]: Entering directory `/sfe/sources/chris/asterisk-1.4.2/menuselect'

gmake[2]: Entering directory `/sfe/sources/chris/asterisk-1.4.2/menuselect'

cc-o menuselect.o -g -c -D_GNU_SOURCE menuselect.c

"menuselect.c", line 165: syntax error before or at: {

"menuselect.c", line 165: undefined symbol: cur

"menuselect.c", line 165: non-unique member requires struct/union pointer: list

"menuselect.c", line 165: left operand of "->" must be pointer to struct/union

"menuselect.c", line 165: warning: assignment type mismatch:

pointer to struct depend {pointer to const char name, pointer to struct member {..} member, struct {..} list} "=" pointer to struct dep_file {array[32] of char name, int met, struct {..} list}

"menuselect.c", line 165: non-unique member requires struct/union pointer: list

"menuselect.c", line 165: left operand of "->" must be pointer to struct/union

"menuselect.c", line 165: warning: improper pointer/integer combination: op "=="

"menuselect.c", line 165: undefined symbol: cur

"menuselect.c", line 165: cannot recover from previous errors

cc: acomp failed for menuselect.c

gmake[2]: *** [menuselect.o] Error 2

gmake[2]: Leaving directory `/sfe/sources/chris/asterisk-1.4.2/menuselect'

gmake[1]: *** [all] Error 2

gmake[1]: Leaving directory `/sfe/sources/chris/asterisk-1.4.2/menuselect'

gmake: *** [menuselect/menuselect] Error 2

I had to remove all the -Wall options from the menuselect Makefile. Are you saying you did not?

c_chana at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 11

> CC=/home/chris/SUNWspro/bin/cc

> cc -o menuselect.o -g -c -D_GNU_SOURCE menuselect.c

The fact that it uses cc and not the whole path as specified in CC looks suspicious to me. Are you sure it is using the right compiler? Try putting /home/chris/SUNWspro/bin at the beginning of your PATH.

Marc_Glissea at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 12
BTW. Could you also provide output of '/home/chris/SUNWspro/bin/cc -V' ?
dmikha at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 13

I do have /home/chris/SUNWspro/bin at the beginning of my path.

Last login: Thu Apr 19 14:50:57 2007 from 192.168.168.1

Sun Microsystems Inc.SunOS 5.11snv_59 October 2007

-bash-3.00$ echo $PATH

/home/chris/SUNWspro/bin:/usr/perl5/bin:/usr/ccs/bin:/usr/bin:/opt/sfw/bin:/usr /ucb

-bash-3.00$

cc -V

-bash-3.00$ /home/chris/SUNWspro/bin/cc -v

usage: cc [ options] files. Use 'cc -flags' for details

-bash-3.00$ /home/chris/SUNWspro/bin/cc -V

cc: Sun C 5.8 Patch 121016-05 2007/01/10

usage: cc [ options] files. Use 'cc -flags' for details

-bash-3.00$

I do have Sun Studio 11 in /opt/SUNspro FYI.

c_chana at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 14
It appears from the output you provided that the compiler your are using is Sun Studio 11 (version 5.8). Typeof is only supported in Sun Studio 12 EA (and later). Using Sun Studio 11, I get the same error messages as you do.
ddpa at 2007-7-11 23:52:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 15
Doh, must have untarred from the wrong tarball.Sorry for the noise.
c_chana at 2007-7-21 20:02:41 > top of Java-index,Development Tools,Solaris and Linux Development Tools...