From: Claudio L. <c_l...@ho...> - 2005-12-11 10:24:13
|
Hello, I am not able to compile metaclasses with occ (versions 2.7, 2.8, or CVS) on the mac. I was able to create the occ executable, but then when I use it I get the following (other errors were fixed following advice from the forum): occ -m BeforeClass.mc EXECUTING: g++ g++ -D__opencxx -E -o BeforeClass.occ -x c++ BeforeClass.mc /usr/include/stdio.h:258: parse error before `"_" "fprintf" "$LDBLStub"' /usr/include/stdio.h:342: parse error before `"_" "snprintf" "$LDBLStub"' /usr/include/stdio.h:374: parse error before `"_" "__svfscanf" "$LDBLStub"' /usr/include/wchar.h:124: parse error before `"_" "fwprintf" "$LDBLStub"' /usr/include/stdlib.h:181: parse error before `"_" "strtold" "$LDBLStub"' The errors above point to the following definitions: /usr/include/sys/cdefs.h: #define __STRING(x) #x #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1040 # define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBLStub") #else # define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBL128") #endif /usr/include/stdio.h: int fprintf(FILE * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(fprintf); Any suggestion on how to work arround/fix this? Thanks! Claudio. |
From: Jonathan G. <gt...@ma...> - 2005-12-11 15:09:14
|
Claudio Levinas wrote: > Hello, > > I am not able to compile metaclasses with occ (versions 2.7, 2.8, or > CVS) on the mac. I was able to create the occ executable, but then > when I use it I get the following (other errors were fixed following > advice from the forum): > > > occ -m BeforeClass.mc > EXECUTING: g++ g++ -D__opencxx -E -o BeforeClass.occ -x c++ > BeforeClass.mc > /usr/include/stdio.h:258: parse error before `"_" "fprintf" "$LDBLStub"' > /usr/include/stdio.h:342: parse error before `"_" "snprintf" "$LDBLStub"' > /usr/include/stdio.h:374: parse error before `"_" "__svfscanf" > "$LDBLStub"' > /usr/include/wchar.h:124: parse error before `"_" "fwprintf" "$LDBLStub"' > /usr/include/stdlib.h:181: parse error before `"_" "strtold" "$LDBLStub"' > > > The errors above point to the following definitions: > > /usr/include/sys/cdefs.h: > #define __STRING(x) #x > #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1040 > # define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBLStub") > #else > # define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBL128") > #endif > > /usr/include/stdio.h: > int fprintf(FILE * __restrict, const char * __restrict, ...) > __DARWIN_LDBL_COMPAT(fprintf); > > > Any suggestion on how to work arround/fix this? > > Thanks! > Claudio. > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > Hi, I heard somewhere that OpenC++ does not support gcc4. I dont' remember where I heard it or if its true but you might want to try gcc 3.4. Sincerely, -- Jonathan Gdalevich Georgia Institute of Technology, Atlanta Georgia, 30332 Email: gt...@pr... |
From: Stefan S. <se...@sy...> - 2005-12-11 15:21:52
|
Jonathan Gdalevich wrote: > Claudio Levinas wrote: >>occ -m BeforeClass.mc >>EXECUTING: g++ g++ -D__opencxx -E -o BeforeClass.occ -x c++ >>BeforeClass.mc >>/usr/include/stdio.h:258: parse error before `"_" "fprintf" "$LDBLStub"' >>/usr/include/stdio.h:342: parse error before `"_" "snprintf" "$LDBLStub"' >>/usr/include/stdio.h:374: parse error before `"_" "__svfscanf" >>"$LDBLStub"' >>/usr/include/wchar.h:124: parse error before `"_" "fwprintf" "$LDBLStub"' >>/usr/include/stdlib.h:181: parse error before `"_" "strtold" "$LDBLStub"' [...] > I heard somewhere that OpenC++ does not support gcc4. I dont' remember > where I heard it or if its true but you might want to try gcc 3.4. The problem is not gcc4, but its use of modern C++ code in the libstdc++ library headers (notably the type_traits, I believe), which occ doesn't parse correctly. The above error, however, seems to stem from system headers, notably some inline assembler code, which, IIRC, should be skipped by the lexer. Regards, Stefan |
From: Claudio L. <c_l...@ho...> - 2005-12-11 20:54:10
|
Lex.cc does indeed skip the keyword, only that it was set to skip "__ASM__". I simply added "__ASM" and it did the job. #if (defined __GNUC__) || (defined _GNUC_SYNTAX) { "__alignof__", token(SIZEOF) }, + { "__asm", token(ATTRIBUTE) }, { "__asm__", token(ATTRIBUTE) }, { "__attribute__", token(ATTRIBUTE) }, Thanks!!! Claudio. >Jonathan Gdalevich wrote: >>Claudio Levinas wrote: >>>occ -m BeforeClass.mc >>>EXECUTING: g++ g++ -D__opencxx -E -o BeforeClass.occ -x c++ >>>BeforeClass.mc >>>/usr/include/stdio.h:258: parse error before `"_" "fprintf" "$LDBLStub"' >>>/usr/include/stdio.h:342: parse error before `"_" "snprintf" "$LDBLStub"' >>>/usr/include/stdio.h:374: parse error before `"_" "__svfscanf" >>>"$LDBLStub"' >>>/usr/include/wchar.h:124: parse error before `"_" "fwprintf" "$LDBLStub"' >>>/usr/include/stdlib.h:181: parse error before `"_" "strtold" "$LDBLStub"' >[...] >>I heard somewhere that OpenC++ does not support gcc4. I dont' remember >>where I heard it or if its true but you might want to try gcc 3.4. >The problem is not gcc4, but its use of modern C++ code in the libstdc++ >library headers (notably the type_traits, I believe), which occ doesn't >parse correctly. >The above error, however, seems to stem from system headers, notably >some inline assembler code, which, IIRC, should be skipped by the lexer. >Regards, > Stefan |
From: <se...@in...> - 2005-12-12 17:01:16
|
On Sun, 2005-12-11 at 12:54 -0800, Claudio Levinas wrote: > Lex.cc does indeed skip the keyword, only that it was set to skip "__ASM__". > I simply added "__ASM" and it did the job. > > #if (defined __GNUC__) || (defined _GNUC_SYNTAX) > { "__alignof__", token(SIZEOF) }, i need an #ifdef SOMETHING > + { "__asm", token(ATTRIBUTE) }, #endif do we have a standard one > { "__asm__", token(ATTRIBUTE) }, > { "__attribute__", token(ATTRIBUTE) }, > > Thanks!!! > Claudio. |
From: Claudio L. <c_l...@ho...> - 2005-12-12 18:28:26
|
>i need an #ifdef SOMETHING > > + { "__asm", token(ATTRIBUTE) }, >#endif >FWIW, I added '__asm' to synopsis' lexer keywords unconditionally a long >time >ago without ever running into trouble. I think this is a fairly safe thing >to >do, as user code never should use names starting with double underscores, >so >there is no or little danger for name clashes. >Regards, > Stefan Please note that the "__asm" token might be inhibiting the "__asm__" token. At least on the mac, the order of these two tokens does seem to be important. When I tried switching the them around, as shown below, the fix didn't work. { "__asm__", token(ATTRIBUTE) }, + { "__asm", token(ATTRIBUTE) }, Claudio. |
From: Claudio L. <c_l...@ho...> - 2005-12-12 18:37:41
|
>Please note that the "__asm" token might be inhibiting the "__asm__" token. >At least on the mac, the order of these two tokens does seem to be >important. When I tried switching the them around, as shown below, the fix >didn't work. > > { "__asm__", token(ATTRIBUTE) }, >+ { "__asm", token(ATTRIBUTE) }, > >Claudio. On the other hand, there are many examples in the list that suggest that "__asm" followed by "__asm__" should be fine: { "__restrict", token(Ignore) }, { "__restrict__", token(Ignore) }, { "__signed", token(SIGNED) }, { "__signed__", token(SIGNED) }, etc... Claudio. |
From: Stefan S. <se...@sy...> - 2005-12-12 17:09:13
|
Gilles J. Seguin wrote: > On Sun, 2005-12-11 at 12:54 -0800, Claudio Levinas wrote: > >>Lex.cc does indeed skip the keyword, only that it was set to skip "__ASM__". >>I simply added "__ASM" and it did the job. >> >>#if (defined __GNUC__) || (defined _GNUC_SYNTAX) >> { "__alignof__", token(SIZEOF) }, > > > i need an #ifdef SOMETHING > >>+ { "__asm", token(ATTRIBUTE) }, > > #endif > > do we have a standard one FWIW, I added '__asm' to synopsis' lexer keywords unconditionally a long time ago without ever running into trouble. I think this is a fairly safe thing to do, as user code never should use names starting with double underscores, so there is no or little danger for name clashes. Regards, Stefan |
From: <se...@in...> - 2005-12-12 19:06:07
|
On Mon, 2005-12-12 at 12:06 -0500, Stefan Seefeld wrote: > Gilles J. Seguin wrote: > > On Sun, 2005-12-11 at 12:54 -0800, Claudio Levinas wrote: > > > >>Lex.cc does indeed skip the keyword, only that it was set to skip "__ASM__". > >>I simply added "__ASM" and it did the job. > >> > >>#if (defined __GNUC__) || (defined _GNUC_SYNTAX) > >> { "__alignof__", token(SIZEOF) }, > > > > > > i need an #ifdef SOMETHING > > > >>+ { "__asm", token(ATTRIBUTE) }, > > > > #endif > > > > do we have a standard one > > FWIW, I added '__asm' to synopsis' lexer keywords unconditionally a long time > ago without ever running into trouble. I think this is a fairly safe thing to > do, as user code never should use names starting with double underscores, so > there is no or little danger for name clashes. > > Regards, > Stefan have commit on branch rel_2_8 new revision: 1.2.2.5; thanks to Claudio Levinas for the patch |