Smoke - Aug 10, 2013 15:26
Hi,
Using the current repo head (12302) I get the following warnings and errors when compiling with gcc 4.9 on osx10.8.4 :
warning 1 :
[spoiler] CC loginlog_sql.c
LD login-server
ld: warning: directory not found for option '-L/usr/local/lib'
login.h:96:28: warning: type of 'login_config' does not match original declaration [enabled by default]
extern struct Login_Config login_config;
^
login.c:24:21: note: previously declared here
struct Login_Config login_config;
^
ld: warning: directory not found for option '-L/usr/local/lib'[/spoiler]
warning 2 and error:
[spoiler]
CC mapreg_sql.c
LD map-server
ld: warning: directory not found for option '-L/usr/local/lib'
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
bool StatusDisplayType[SC_MAX];
^
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
bool StatusDisplayType[SC_MAX];
^
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
bool StatusDisplayType[SC_MAX];
^
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: warning: type of 'StatusDisplayType' does not match original declaration [enabled by default]
status.h:1603:6: note: previously declared here
bool StatusDisplayType[SC_MAX];
^
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
} hChSys;
^
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:0: warning: type of 'hChSys' does not match original declaration [enabled by default]
} hChSys;
^
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
} hChSys;
^
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:0: warning: type of 'hChSys' does not match original declaration [enabled by default]
} hChSys;
^
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
} hChSys;
^
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:3: warning: type of 'hChSys' does not match original declaration [enabled by default]
clif.h:420:0: warning: type of 'hChSys' does not match original declaration [enabled by default]
} hChSys;
^
clif.h:420:3: note: previously declared here
} hChSys;
^
lto1: internal compiler error: in inline_call, at ipa-inline-transform.c:271
lto1: internal compiler error: Abort trap: 6
gcc: internal compiler error: Abort trap: 6 (program lto1)
lto-wrapper: gcc terminated with signal 6 [Abort trap: 6]
collect2: error: lto-wrapper returned 1 exit status
make[1]: *** [map-server] Error 1
make: *** [map_sql] Error 2[/spoiler]
gcc version 4.9.0 20130728 (experimental) (MacPorts gcc49 4.9-20130728_1)
Haru - Aug 11, 2013 14:11
We're doing something wrong that gcc-4.9+ seems not to like. I haven't researched it in depth yet, but I believe it's related to some missing includes. I do not think it's related to the OS, but rather the GCC version only.
Haru - Aug 11, 2013 14:52
From login.c, preprocessor output (gcc-4.9 -E):[code=auto:0]
struct Login_Config {
uint32 login_ip;
uint16 login_port;
unsigned int ipban_cleanup_interval;
unsigned int ip_sync_interval;
_Bool log_login;
char date_format[32];
_Bool new_account_flag,new_acc_length_limit;
int start_limited_time;
_Bool use_md5_passwds;
int group_id_to_connect;
int min_group_id_to_connect;
_Bool check_client_version;
uint32 client_version_to_connect;
_Bool ipban;
_Bool dynamic_pass_failure_ban;
unsigned int dynamic_pass_failure_ban_interval;
unsigned int dynamic_pass_failure_ban_limit;
unsigned int dynamic_pass_failure_ban_duration;
_Bool use_dnsbl;
char dnsbl_servs[1024];
int client_hash_check;
struct client_hash_node *client_hash_nodes;
};
[/code]
From ipban_sql.c, preprocessor output:[code=auto:0]
struct Login_Config {
uint32 login_ip;
uint16 login_port;
unsigned int ipban_cleanup_interval;
unsigned int ip_sync_interval;
bool log_login;
char date_format[32];
bool new_account_flag,new_acc_length_limit;
int start_limited_time;
bool use_md5_passwds;
int group_id_to_connect;
int min_group_id_to_connect;
bool check_client_version;
uint32 client_version_to_connect;
bool ipban;
bool dynamic_pass_failure_ban;
unsigned int dynamic_pass_failure_ban_interval;
unsigned int dynamic_pass_failure_ban_limit;
unsigned int dynamic_pass_failure_ban_duration;
bool use_dnsbl;
char dnsbl_servs[1024];
int client_hash_check;
struct client_hash_node *client_hash_nodes;
};
[/code]
If you #include "../common/HPM.h" from ipban_sql.c, then the 'bool' in it will be '_Bool' as well.
If you comment out the #include <dlfcn.h> from HPM.h, all the '_Bool' will be 'bool' again. (code won't compile of course - I only checked the preprocessor's output)
The same happens with older gcc versions (i.e. i686-apple-darwin11-llvm-gcc-4.2), but they don't complain about it.
Ideas?
Edit: <dlfcn.h> includes <stdbool.h>, which typedefs bool as _Bool. If all supported compilers allow that, we should use it instead of typedeffing our own bool (it's part of C99 - did Microsoft comply yet?). At least on the platforms/compilers that support it.
Haru - Aug 14, 2013 13:32
Fixed in [url="https://github.com/HerculesWS/Hercules/commit/ab1fad052cd771e183f496f5db922fa03a13edea"]https://github.com/HerculesWS/Hercules/commit/ab1fad052cd771e183f496f5db922fa03a13edea[/url]