CC compiler problem with <string.h>

Hi,

I use Sun Studio Express (3-Dec-2006 Build) on SUSE Linux 10.1.

When I was trying to compile the following code, I got an error message regarding <string.h>. The same codes works fine with g++ compiler.

Please give me some comments on that.

Thanks.

Tae-Suk Bae

-

#include <stdio.h>

#include <string.h>

int main(int argc, char**argv) {

char str[80];

strcpy(str,"Test");

printf("%s\n",str);

return 0;

}

-

CC-c -g -o build/Debug/Sun-Linux-x86/welcome.o welcome.cc

(/home/baezae/ngsode/Welcome1)welcome.cc:

"/usr/include/string.h", line 272: Error: End of file encountered in macro arguments for "__nonnull".

"/usr/include/string.h", line 272: Error: ")" expected instead of "(".

"/usr/include/string.h", line 272: Error: Unexpected ")" -- Check for matching parenthesis.

"/usr/include/string.h", line 272: Error: Operand expected instead of ";".

"/usr/include/string.h", line 426: Error: "strerror_r(int, char*, unsigned)" is expected to return a value.

"welcome.cc", line 30: Error: "}" expected instead of "end of file".

6 Error(s) detected.

-

[1221 byte] By [baezaea] at [2007-11-27 2:59:50]
# 1
I have that feeling that this has been solved in later version, February build. It is available for download here: http://developers.sun.com/sunstudio/downloads/express.jspMaybe compiler experts will be able to provide more accurate answer, though.
MaximKartasheva at 2007-7-12 3:40:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
I think this is discussed more here: http://forum.java.sun.com/thread.jspa?forumID=855&threadID=5109045
ChrisQuenellea at 2007-7-12 3:40:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...