Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-26-2004
peter.s peter.s is offline
Registered User
 
 
Join Date: Mar 2004
Posts: 12
problem in C++ include file ordering

I don't know if this really can be called a bug, anyway the effect of this issue is not nice:

if I have a test.ice and include the following header files:

Code:
#include <stdint.h>
#include <test.h>
the file will not compile, because:

the generated test.h includes IceUtil/Config.h
which sets the parameter __STDC_LIMIT_MACROS and afterwards includes <stdint.h>

but, if stdint.h has already been included before, it won't be included a second time and the INT64_MAX ... macros won't be defined and the compiler exits with an error at the lines:

Code:
    198 // Assumes ISO C99 types
    199 //
    200 typedef int64_t Int64;
    201 const Int64 Int64Min = INT64_MIN;
    202 const Int64 Int64Max = INT64_MAX;
in IceUtil/Config.h with the error message that INT64_MIN and INT64_MAX are not defined.

I think this is not really a nice way to include stdint.h but I have to admit I don't know if using one of the other methods which already are in IceUtil.h could deliver all needed variables.

greetings,
Peter
Reply With Quote
  #2 (permalink)  
Old 03-26-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 896
Hmmm... I don't think there is anything much we can do about this. This really is a shortcoming of the entire #include and preprocessing machinery.

I'd suggest to always put the Ice headers first, followed by any system headers. That way, the problem can't arise (and that's what we do in our own code.)

Cheers,

Michi.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python: #include/import problem with slice2py hiasl Bug Reports 1 02-21-2006 09:59 AM
IceGrid problem with file names with space character kovacm Bug Reports 2 12-12-2005 09:10 AM
IcePach2 problem with czech file names kovacm Bug Reports 1 11-28-2005 01:00 PM
Slice2cpp Include Problem tony_h Help Center 4 08-27-2004 11:28 AM
Freeze map ordering dwk Help Center 1 04-26-2004 07:44 PM


All times are GMT -4. The time now is 12:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.