This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem compiling DDD-3.3 on Solaris 8/SPARC (and possible fix?)


Hi!

Mike Bland <mbland@pcs.cnu.edu> writes:

> Since this is a compile-time problem, please forgive my exclusion of DDD
> configuration/log information.  Here is the vital info:
> 
> 	DDD version:	3.3
> 	OS:		Solaris 8
> 	Arch:		sparcv9
> 	g++ version:	2.95.2 19991024
> 
> A transcript of the compiler output follows.  In the file SourceView.C,
> I'm getting errors for two lines of code which are both identical to:
> 
> 	next_l = ULONG_MAX;
> 
> The g++ warning/error messages are:
> 
> 	integer constant out of range
> 	warning: decimal integer constant is so large that it is unsigned
> 
> The two instances appear in:
> 
> 	static bool SourceView::function_is_larger_than(string, int)
> 	static void SourceView::show_pc(const string &, XmHighlightMode =
> 		XmHIGHLIGHT_NORMAL, bool = false, bool = false)
> 
> I suspect this is because the 64-bit ULONG_MAX goes far beyond the 32-bit
> unsigned long that g++ is capable of producing.

Hmmm - normally, ULONG_MAX should fit into an `unsigned long' without
any problems.  I have cc'ed this reply to the GCC maintainers.

The `official' workaround is already in the source file:

#ifndef ULONG_MAX
#define	ULONG_MAX	((unsigned long)(~0L))		/* 0xFFFFFFFF */
#endif

This should work on most, if not all, architectures.  If the problem
persists with future GCC releases, I'll make the DDD `configure'
script check for it.

Best wishes,

Andreas

-- 
Andreas Zeller     Universitaet Passau
                   http://www.fmi.uni-passau.de/st/staff/zeller/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]