Archived
This forum has been archived. Please start a new discussion on GitHub.
include/IceUtil/Config.h:196: error: `INT64_MIN' was not declared in this scope
Hi :
I found a bug in include/IceUtil/Config.h:196, it's not always occured, but few time will occured. the error is :
In file included from ../../include/IceUtil/Exception.h:13,
from Exception.cpp:10:
../../include/IceUtil/Config.h:196: error: `INT64_MIN' was not declared in this scope
../../include/IceUtil/Config.h:197: error: `INT64_MAX' was not declared in this scope
if I define as following , it's will okay.
#ifndef INT64_MIN
#define INT64_MIN (-(9223372036854775807 ## L)-1)
#endif
#ifndef INT64_MAX
#define INT64_MAX ((9223372036854775807 ## L))
#endif
I found a bug in include/IceUtil/Config.h:196, it's not always occured, but few time will occured. the error is :
In file included from ../../include/IceUtil/Exception.h:13,
from Exception.cpp:10:
../../include/IceUtil/Config.h:196: error: `INT64_MIN' was not declared in this scope
../../include/IceUtil/Config.h:197: error: `INT64_MAX' was not declared in this scope
if I define as following , it's will okay.
#ifndef INT64_MIN
#define INT64_MIN (-(9223372036854775807 ## L)-1)
#endif
#ifndef INT64_MAX
#define INT64_MAX ((9223372036854775807 ## L))
#endif
0
Comments
-
Which compiler is this? I've never seen this error before with any of our supported compilers. In any case, I guess it's a good idea to add these macros, just in case some compiler doesn't define INT64_MIN and INT64_MAX.0
-
gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-thread
s=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)
I think it isn't relation of compiler, for exmaple , when I include <phonelist.h>, it's okay, but when I include <phonelistI.h> , it will occur this error. I think the bug is in this:
# ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
# endif
# include <stdint.h>
#endif0 -
Originally posted by dragzhb
I think it isn't relation of compiler, for exmaple , when I include <phonelist.h>, it's okay, but when I include <phonelistI.h> , it will occur this error.
That is strange. Presumably, phonelistI.h includes phonelist.h?I think the bug is in this:
# ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
# endif
# include <stdint.h>
#endif
Could you post a concrete source file that shows the problem? I'm reluctant to mess with Config.h unless it's really necessary. I'd like to understand what is happening properly first.
Cheers,
Michi.0 -
yes , phonelistI.h includes phonelist.h.
I am feeling strange too. I including phonelist.h is okay , but my company colleague including phonelist.h and with ACE, it will occur this error.
I don't know why ? the source code is very simple . it use slice2cpp to create, I think I don't need to pass source up.
the repeat steps:
create a ice file like this :
#ifndef _DBENGINE_ICE
#define _DBENGINE_ICE
//#include <contentdata.ice>
module pnote
{
sequence<byte> ContentList;
exception ShutDownError
{
string reason;
};
/* DCS 0 - english; 8 - unicode */
struct DBEngineData
{
long ID;
//string PhoneNo;
//short GroupID;
//short RuleID;
bool ContentFlag;
//short ContentID;
short DCS;
ContentList Content;
};
interface DBEngineHome
{
["ami", "amd"] nonmutating DBEngineData find(long ID,string strPhoneNo) throws ShutDownError;
};
};
#endif _DBENGINE_ICE
the use following command to create file.
dbengineI.cpp:$(top_srcdir)/slice/dbengine.ice
slice2cpp --impl $(ICE_FLAGS) $(top_srcdir)/slice/dbengine.ice --output-dir $(top_srcdir)/src/web
Note:
It's not always occur this error , but have few time.0 -
I had another look, and I can't find anything wrong with our code. I suspect that one of the ACE headers is messing with the symbol definitions.
I'd rather leave things as they are at the moment, in the absence of a clear idea of what is actually happening. If you can reproduce this reliably in a small, self-contained example, that would be great -- it would allow us at least to figure exactly why you are getting this problem.
Cheers,
Michi.0 -
I suspect that one of the ACE headers is messing with the symbol definitions.
I tihnk so too .
But I can't reproduce this reliably in a small, self-contained example, beacuse this problem found by my colleague and he has used many package that I don't know.
I found this problem too, but I can't reproduce it now. If I found it too, I will upload it.
But I think it's very simple to add this MICRO and it don't effect other file and it looks like more portable.0