2.0RC4 make warning on OS X 10.4.8 PPC G4
System is OS X 10.4.8, Xcode 2.4, PPC G4(2.7), configure --enable-debug --enable-dynamic-linking I am seeing the following warnings during compiling 2.0RC4: logmsg.c: In function 'log_msg_parse': logmsg.c:149: warning: pointer targets in assignment differ in signedness logmsg.c:212: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness logmsg.c:214: warning: pointer targets in assignment differ in signedness logmsg.c:232: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness logmsg.c:271: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness logmsg.c:309: warning: pointer targets in assignment differ in signedness logmsg.c:313: warning: pointer targets in assignment differ in signedness logmsg.c:344: warning: pointer targets in assignment differ in signedness logmsg.c:378: warning: pointer targets in assignment differ in signedness logmsg.c:389: warning: pointer targets in assignment differ in signedness logmsg.c:401: warning: pointer targets in assignment differ in signedness logmsg.c:413: warning: pointer targets in assignment differ in signedness logmsg.c:435: warning: pointer targets in assignment differ in signedness logmsg.c:440: warning: pointer targets in assignment differ in signedness logmsg.c:445: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness and: affile.c: In function 'affile_dd_init': affile.c:456: warning: comparison is always false due to limited range of data type affile.c:462: warning: comparison is always false due to limited range of data type and: afuser.c: In function 'afuser_dd_queue': afuser.c:57: warning: implicit declaration of function 'getutent' afuser.c:57: warning: assignment makes pointer from integer without a cast and finally: gsockaddr.c: In function 'g_accept': gsockaddr.c:116: warning: pointer targets in passing argument 3 of 'accept' differ in signedness Can these safely be ignored or is there something that needs to be changed to make them go away? --
On Wed, 2006-10-25 at 11:30 -0700, Mr. Brian Opitz wrote:
System is OS X 10.4.8, Xcode 2.4, PPC G4(2.7), configure --enable-debug --enable-dynamic-linking
I am seeing the following warnings during compiling 2.0RC4:
I'm still using gcc 3.4, it is probably gcc 4 that gives these warnings. See my interpretation of these warnings below:
logmsg.c: In function 'log_msg_parse': logmsg.c:149: warning: pointer targets in assignment differ in signedness logmsg.c:212: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness logmsg.c:214: warning: pointer targets in assignment differ in signedness logmsg.c:232: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness logmsg.c:271: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness logmsg.c:309: warning: pointer targets in assignment differ in signedness logmsg.c:313: warning: pointer targets in assignment differ in signedness logmsg.c:344: warning: pointer targets in assignment differ in signedness logmsg.c:378: warning: pointer targets in assignment differ in signedness logmsg.c:389: warning: pointer targets in assignment differ in signedness logmsg.c:401: warning: pointer targets in assignment differ in signedness logmsg.c:413: warning: pointer targets in assignment differ in signedness logmsg.c:435: warning: pointer targets in assignment differ in signedness logmsg.c:440: warning: pointer targets in assignment differ in signedness logmsg.c:445: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness
These seem to be harmless, gchar vs. guchar is passed for various functions.
and:
affile.c: In function 'affile_dd_init': affile.c:456: warning: comparison is always false due to limited range of data type affile.c:462: warning: comparison is always false due to limited range of data type
This might be a problem if the compiler optimizes the if statement out. I have added casts to fix this issue.
and:
afuser.c: In function 'afuser_dd_queue': afuser.c:57: warning: implicit declaration of function 'getutent' afuser.c:57: warning: assignment makes pointer from integer without a cast
hmm... afuser.c has #include <utmp.h> which should define getutent, this seems to be a MacOS specific problem. Can you check which header defines getutent() and whether it is defined at all?
and finally:
gsockaddr.c: In function 'g_accept': gsockaddr.c:116: warning: pointer targets in passing argument 3 of 'accept' differ in signedness
this is probably a socklen_t vs int mismatch. Should not matter if 32 bit platform is used. also fixed.
Can these safely be ignored or is there something that needs to be changed to make them go away?
Here's a patch, that fixes gsockaddr.c and affile.c, can you confirm that? --- orig/src/affile.c +++ mod/src/affile.c @@ -453,13 +453,13 @@ affile_dd_init(LogPipe *s, GlobalConfig self->file_uid = cfg->file_uid; if (self->file_gid == -1) self->file_gid = cfg->file_gid; - if (self->file_perm == -1) + if (self->file_perm == (mode_t) -1) self->file_perm = cfg->file_perm; if (self->dir_uid == -1) self->dir_uid = cfg->dir_uid; if (self->dir_gid == -1) self->dir_gid = cfg->dir_gid; - if (self->dir_perm == -1) + if (self->dir_perm == (mode_t) -1) self->dir_perm = cfg->dir_perm; if (self->time_reap == -1) self->time_reap = cfg->time_reap; @@ -595,9 +595,9 @@ affile_dd_new(gchar *filename, guint32 f self->filename_template = log_template_new(NULL, filename); self->flags = flags; self->file_uid = self->file_gid = -1; - self->file_perm = -1; + self->file_perm = (mode_t) -1; self->dir_uid = self->dir_gid = -1; - self->dir_perm = -1; + self->dir_perm = (mode_t) -1; log_writer_options_defaults(&self->writer_options); if (strchr(filename, '$') == NULL) { --- orig/src/gsockaddr.c +++ mod/src/gsockaddr.c @@ -109,7 +109,7 @@ GIOStatus g_accept(int fd, int *newfd, GSockAddr **addr) { char sabuf[1024]; - int salen = sizeof(sabuf); + socklen_t salen = sizeof(sabuf); do { -- Bazsi
On Thu, 26 Oct 2006 12:41:50 +0200, Balazs Scheidler said:
affile.c: In function 'affile_dd_init': affile.c:456: warning: comparison is always false due to limited range of data type affile.c:462: warning: comparison is always false due to limited range of data type
This might be a problem if the compiler optimizes the if statement out. I have added casts to fix this issue.
You need to be careful here... sometimes this sort of thing is a "fix" rather than a real fix...
- if (self->file_perm == -1) + if (self->file_perm == (mode_t) -1) self->file_perm = cfg->file_perm;
The reason the compiler complains is that if proper type safety has been followed *elsewhere*, it can't have been equal to -1. In other words, if this is the only place you had to add the cast, it's *still* buggy.
On Thu, 2006-10-26 at 13:38 -0400, Valdis.Kletnieks@vt.edu wrote:
On Thu, 26 Oct 2006 12:41:50 +0200, Balazs Scheidler said:
affile.c: In function 'affile_dd_init': affile.c:456: warning: comparison is always false due to limited range of data type affile.c:462: warning: comparison is always false due to limited range of data type
This might be a problem if the compiler optimizes the if statement out. I have added casts to fix this issue.
You need to be careful here... sometimes this sort of thing is a "fix" rather than a real fix...
- if (self->file_perm == -1) + if (self->file_perm == (mode_t) -1) self->file_perm = cfg->file_perm;
The reason the compiler complains is that if proper type safety has been followed *elsewhere*, it can't have been equal to -1. In other words, if this is the only place you had to add the cast, it's *still* buggy.
I know. -1 is used as an extremal value, and this is explicitly assigned to the variable elsewhere. -1 basically means: "use default", any other value means that the user overrode the default. Instead of -1 I could have been used MAXINT, but I feel -1 more readable and more consistent with the rest of the code. -- Bazsi
Hi Brian, As I read your post, I¹m wondering if you get syslog-ng working on 10.4 server (or client) I used darwinport to install v1.6.11 on a 10.4.8 Server last week. It builds fine but I cannot get it to log anything, either from the local or a distant server. What¹s your opinion on this subject ? le 25/10/06 20:30, Mr. Brian Opitz à mrbriano@ofarrell-mail.sandi.net a écrit :
System is OS X 10.4.8, Xcode 2.4, PPC G4(2.7), configure --enable-debug --enable-dynamic-linking
I am seeing the following warnings during compiling 2.0RC4:
logmsg.c: In function 'log_msg_parse': logmsg.c:149: warning: pointer targets in assignment differ in signedness logmsg.c:212: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness logmsg.c:214: warning: pointer targets in assignment differ in signedness logmsg.c:232: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness logmsg.c:271: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness logmsg.c:309: warning: pointer targets in assignment differ in signedness logmsg.c:313: warning: pointer targets in assignment differ in signedness logmsg.c:344: warning: pointer targets in assignment differ in signedness logmsg.c:378: warning: pointer targets in assignment differ in signedness logmsg.c:389: warning: pointer targets in assignment differ in signedness logmsg.c:401: warning: pointer targets in assignment differ in signedness logmsg.c:413: warning: pointer targets in assignment differ in signedness logmsg.c:435: warning: pointer targets in assignment differ in signedness logmsg.c:440: warning: pointer targets in assignment differ in signedness logmsg.c:445: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness
and:
affile.c: In function 'affile_dd_init': affile.c:456: warning: comparison is always false due to limited range of data type affile.c:462: warning: comparison is always false due to limited range of data type
and:
afuser.c: In function 'afuser_dd_queue': afuser.c:57: warning: implicit declaration of function 'getutent' afuser.c:57: warning: assignment makes pointer from integer without a cast
and finally:
gsockaddr.c: In function 'g_accept': gsockaddr.c:116: warning: pointer targets in passing argument 3 of 'accept' differ in signedness
Can these safely be ignored or is there something that needs to be changed to make them go away?
--
_______________________________________________ syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
Brian, list, etc, You'll see I posted to the list with the same frustrations back in 2005... I gave up trying to get syslog 1.6 and 1.9.x to log a nything on my 10.4.x servers. They log perfectly on my Panther servers! It's really a bummer... -- Alan Orth Upward Bound - Systems Administrator User Services - Field Technician California State University, Chico x6000 -----Original Message----- From: syslog-ng-bounces@lists.balabit.hu on behalf of Olivier DUCROT Sent: Thu 10/26/2006 11:34 PM To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: Re: [syslog-ng] 2.0RC4 make warning on OS X 10.4.8 PPC G4 Hi Brian, As I read your post, I¹m wondering if you get syslog-ng working on 10.4 server (or client) I used darwinport to install v1.6.11 on a 10.4.8 Server last week. It builds fine but I cannot get it to log anything, either from the local or a distant server. What¹s your opinion on this subject ? le 25/10/06 20:30, Mr. Brian Opitz à mrbriano@ofarrell-mail.sandi.net a écrit :
System is OS X 10.4.8, Xcode 2.4, PPC G4(2.7), configure --enable-debug --enable-dynamic-linking
I am seeing the following warnings during compiling 2.0RC4:
logmsg.c: In function 'log_msg_parse': logmsg.c:149: warning: pointer targets in assignment differ in signedness logmsg.c:212: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness logmsg.c:214: warning: pointer targets in assignment differ in signedness logmsg.c:232: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness logmsg.c:271: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness logmsg.c:309: warning: pointer targets in assignment differ in signedness logmsg.c:313: warning: pointer targets in assignment differ in signedness logmsg.c:344: warning: pointer targets in assignment differ in signedness logmsg.c:378: warning: pointer targets in assignment differ in signedness logmsg.c:389: warning: pointer targets in assignment differ in signedness logmsg.c:401: warning: pointer targets in assignment differ in signedness logmsg.c:413: warning: pointer targets in assignment differ in signedness logmsg.c:435: warning: pointer targets in assignment differ in signedness logmsg.c:440: warning: pointer targets in assignment differ in signedness logmsg.c:445: warning: pointer targets in passing argument 2 of 'g_string_assign_len' differ in signedness
and:
affile.c: In function 'affile_dd_init': affile.c:456: warning: comparison is always false due to limited range of data type affile.c:462: warning: comparison is always false due to limited range of data type
and:
afuser.c: In function 'afuser_dd_queue': afuser.c:57: warning: implicit declaration of function 'getutent' afuser.c:57: warning: assignment makes pointer from integer without a cast
and finally:
gsockaddr.c: In function 'g_accept': gsockaddr.c:116: warning: pointer targets in passing argument 3 of 'accept' differ in signedness
Can these safely be ignored or is there something that needs to be changed to make them go away?
--
_______________________________________________ syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
participants (5)
-
Balazs Scheidler
-
Mr. Brian Opitz
-
Olivier DUCROT
-
Orth, Alan
-
Valdis.Kletnieks@vt.edu