public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC compiling problem on solaris intel machine
@ 2002-11-26  6:06 Jing Lee
  2002-11-27  0:28 ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Jing Lee @ 2002-11-26  6:06 UTC (permalink / raw)
  To: gcc-help

Hi,

I have encountered some problem while using gcc 3.2 to compile a c++ package
generated by jnipp.

Here's the details:

gcc -O0 -c -fPIC -Wall -I. -I/home/admin/jnipp/include -I/opt/java/j2sdk1.4.
1_01/include
 -I/opt/java/j2sdk1.4.1_01/include/solaris java/util/LocalProxy.cpp -o
java/util/LocaleProxy.o
============================================================================
=
In file included from java/util/ResourceBundleProxy.h:30,
			from java/util/LocaleProxy.cpp:5:
sun/misc/SoftCacheProxyForward.h:5: parse error before numeric constant
===========================================================================
Looking at ResourceBundleProxy.h, line 30 is:  #include
"sun/misc/SoftCacheProxyForward.h",
but sun/misc/SoftCacheProxyForward.h is as this:

#ifndef __sun_misc_ResourceProxyForward_H
#define __sun_misc_ResourceProxyForward_H

namespace sun
{
	namespace misc
	{
		class ResourceProxy;
	}
}
#endif

line 5 is:  namespace sun.

I've been spent whole week working on it, but have no clue at all. Is there
anything wrong with my configuration?  Is there any gcc option that can help
me by-pass this?  I read some messages regarding the similar problem, but
counld not find any answer.  If anyone has experience on this, please do
help me out!!!!!!!

Thanks a lot and waiting for the early reply!!!

Jane Li

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC compiling problem on solaris intel machine
  2002-11-26  6:06 GCC compiling problem on solaris intel machine Jing Lee
@ 2002-11-27  0:28 ` Florian Weimer
  2002-11-27  6:33   ` Eljay Love-Jensen
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2002-11-27  0:28 UTC (permalink / raw)
  To: Jing Lee; +Cc: gcc-help

"Jing Lee" <jlee@kang.bondnet.com> writes:

> sun/misc/SoftCacheProxyForward.h:5: parse error before numeric constant

> #ifndef __sun_misc_ResourceProxyForward_H
> #define __sun_misc_ResourceProxyForward_H
>
> namespace sun
> {

You are compiling this on Solaris, right?

"sun" is probably a predefined preprocessor macro, so after
preprocessing your code becomes:

| namespace 1
| {

I'm sorry, I don't know how you can get rid of the "sun" macro without
disturbing the header files.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC compiling problem on solaris intel machine
  2002-11-27  0:28 ` Florian Weimer
@ 2002-11-27  6:33   ` Eljay Love-Jensen
  2002-11-27 15:09     ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Eljay Love-Jensen @ 2002-11-27  6:33 UTC (permalink / raw)
  To: Florian Weimer, Jing Lee; +Cc: gcc-help

#undef sun
(before including other header files)

or

-Usun
(on the g++ command line, if it's a "built in" define)

--Eljay

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC compiling problem on solaris intel machine
  2002-11-27  6:33   ` Eljay Love-Jensen
@ 2002-11-27 15:09     ` Florian Weimer
  2002-12-02  5:45       ` Eljay Love-Jensen
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2002-11-27 15:09 UTC (permalink / raw)
  To: Eljay Love-Jensen; +Cc: Jing Lee, gcc-help

Eljay Love-Jensen <eljay@adobe.com> writes:

> #undef sun
> (before including other header files)

Yes, but this might change what the header files do!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC compiling problem on solaris intel machine
  2002-11-27 15:09     ` Florian Weimer
@ 2002-12-02  5:45       ` Eljay Love-Jensen
  0 siblings, 0 replies; 5+ messages in thread
From: Eljay Love-Jensen @ 2002-12-02  5:45 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Jing Lee, gcc-help

Hi Florian,

 >Yes, but this might change what the header files do!

Correct, it might.

Alternatively, don't use "sun" identifier as a namespace, since the 
identifier is macro-tainted.

Aside, hmmm, aren't these kinds of macros supposed to be __sun or _SUN, for 
exactly this reason -- to avoid preprocessor identifier collisions with 
otherwise valid code?  Grrrrrr.

--Eljay
(I hate macros.)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-12-02 13:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-26  6:06 GCC compiling problem on solaris intel machine Jing Lee
2002-11-27  0:28 ` Florian Weimer
2002-11-27  6:33   ` Eljay Love-Jensen
2002-11-27 15:09     ` Florian Weimer
2002-12-02  5:45       ` Eljay Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).