some messages from a contemporary HP-UX 11.23 compiler
Mark Andrews
Mark_Andrews at isc.org
Tue Nov 15 00:38:39 UTC 2005
> For my own nefarious porpoises I decided to download and compile 9.3.2b2 on a
> n
> HP-UX 11iv2 (aka 11.23) IPF system with what I believe is a very up-to-date
> compiler. A number of messages were emitted which may or may not be of impor
> t,
> and honestly, I'm not sure if they point fingers at BIND code or the compiler
> .
I suspect the answer is both.
> Here is a sample, I can forward the entire make log to those who wish to see
> it.
>
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I./include -I./../pthreads/includ
> e -
> I../include -I./../include -I./.. -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED
> -g
> +w1 +W 474,530,2193,2236 -c entropy.c
> "../entropy.c", line 329: remark #4232-D: conversion from "isc_uint8_t *" to
> a m
> ore strictly aligned type "isc_uint32_t *" may cause misaligned access
> val = *((isc_uint32_t *)buf);
^
The code immediately before this should prevent the problem by causing
buf to be properly aligned.
This should silence the compiler.
val = *((isc_uint32_t *)(void *)buf);
> "../entropy.c", line 609: remark #4235-D: conversion from "int" to "isc_uint8
> _t"
> may lose significant bits
> buf[i] = digest[i] ^ digest[i + RND_ENTROPY_THRESHOL
> D];
^
The compiler should be able to work out that this cannot occur.
digest and buf are both the same size. The number of significant
bits never get above 8.
> "entropy.c", line 129: remark #4235-D: conversion from "ssize_t" to "unsigned
> ch
> ar" may lose significant bits
> buf[0] = ndesired;
Hopefully a cast will shutup this warning.
> "entropy.c", line 144: remark #4235-D: conversion from "ssize_t" to "unsigned
> ch
> ar" may lose significant bits
> buf[1] = ndesired;
> ^
Hopefully a cast will shutup this warning.
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I./include -I./../pthreads/includ
> e -
> I../include -I./../include -I./.. -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED
> -g
> +w1 +W 474,530,2193,2236 -c file.c
> "file.c", line 97: remark #3348-D: declaration hides function "time" (declare
> d a
> t line 248 of "/usr/include/sys/time.h")
> isc_file_getmodtime(const char *file, isc_time_t *time) {
^
Bad choice of variable name.
> "file.c", line 117: remark #3348-D: declaration hides function "time" (declar
> ed
> at line 248 of "/usr/include/sys/time.h")
> isc_file_settime(const char *file, isc_time_t *time) {
Bad choice of variable name.
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I./include -I./../pthreads/includ
> e -
> I../include -I./../include -I./.. -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED
> -g
> +w1 +W 474,530,2193,2236 -c interfaceiter.c
> "interfaceiter.c", line 81: remark #4232-D: conversion from "struct sockaddr
> *"
> to a more strictly aligned type "struct sockaddr_in *" may cause misaligned a
> cce
> ss
> &((struct sockaddr_in *) src)->sin_addr,
^
We need some way to tell the compiler that a set of structures need
to have complementry alignments.
> "interfaceiter.c", line 85: remark #4232-D: conversion from "struct sockaddr
> *"
> to a more strictly aligned type "struct sockaddr_in6 *" may cause misaligned
> acc
> ess
> sa6 = (struct sockaddr_in6 *)src;
> ^
>
> "ifiter_ioctl.c", line 541: remark #4232-D: conversion from "char *" to a mor
> e s
> trictly aligned type "struct ifreq *" may cause misaligned access
> ifrp = (struct ifreq *)((char *) iter->ifc.ifc_req + iter->pos);
> ^
>
> "ifiter_ioctl.c", line 651: remark #4235-D: conversion from "int" to "uint8_t
> " m
> ay lose significant bits
> iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0
> xff;
> ^
>
> "ifiter_ioctl.c", line 724: remark #4232-D: conversion from "char *" to a mor
> e s
> trictly aligned type "struct if_laddrreq *" may cause misaligned access
> ifrp = (struct LIFREQ *)((char *) iter->lifc.lifc_req + iter->pos6);
> ^
>
>
>
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I./include -I./../pthreads/includ
> e -
> I../include -I./../include -I./.. -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED
> -g
> +w1 +W 474,530,2193,2236 -c time.c
> "time.c", line 370: warning #2068-D: integer conversion resulted in a change
> of
> sign
> (i = (time_t)-1) != 4294967295u && /* Is signed.
> */
> ^
This is a trap for time_t != signed 32 bits.
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I./unix/include -I./pthreads/incl
> ude
> -I./include -I./include -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -g +w1
> +W 4
> 74,530,2193,2236 -c ratelimiter.c
> "ratelimiter.c", line 145: remark #3348-D: declaration hides variable "ev" (d
> ecl
> ared at line 135)
> isc_event_t *ev = *eventp;
> ^
>
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I./unix/include -I./pthreads/incl
> ude
> -I./include -I./include -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -g +w1
> +W 4
> 74,530,2193,2236 -c result.c
> "result.c", line 112: remark #3348-D: declaration hides variable "text" (decl
> are
> d at line 41)
> register_table(unsigned int base, unsigned int nresults, const char **text
> ,
> ^
>
> "result.c", line 170: remark #3348-D: declaration hides variable "text" (decl
> are
> d at line 41)
> const char *text, *default_text;
> ^
>
> "result.c", line 205: remark #3348-D: declaration hides variable "text" (decl
> are
> d at line 41)
> const char **text, isc_msgcat_t *msgcat, int set)
> ^
>
>
>
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I./unix/include -I./pthreads/incl
> ude
> -I./include -I./include -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -g +w1
> +W 4
> 74,530,2193,2236 -c sockaddr.c
> "sockaddr.c", line 132: remark #2181-D: argument is incompatible with corresp
> ond
> ing format string conversion
> snprintf(pbuf, sizeof(pbuf), "%u", ntohs(sockaddr->type.sin.
> sin_
> port));
> ^
>
>
> "sockaddr.c", line 135: remark #2181-D: argument is incompatible with corresp
> ond
> ing format string conversion
> snprintf(pbuf, sizeof(pbuf), "%u", ntohs(sockaddr->type.sin6
> .sin
> 6_port));
> ^
>
> "sockaddr.c", line 357: remark #4235-D: conversion from "unsigned int" to "sa
> _fa
> mily_t" may lose significant bits
> sockaddr->type.sin.sin_family = na->family;
> ^
>
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I. -I/tmp/bind-9.3.2b2/lib/dns/inc
> lude
> -I../../lib/dns/include -I/tmp/bind-9.3.2b2/lib/isc/include -I../../lib/i
> sc
> -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/isc/pthrea
> ds/
> include -I/tmp/bind-9.3.2b2/lib/isccc/include -I../../lib/isccc/include -D
> _RE
> ENTRANT -D_XOPEN_SOURCE_EXTENDED -g +w1 +W 474,530,2193,2236 -c cc.c
> "cc.c", line 85: remark #4235-D: conversion from "unsigned long" to "unsigned
> ch
> ar" may lose significant bits
> PUT32(len, target->rstart);
> ^
>
> "cc.c", line 85: remark #4235-D: conversion from "unsigned long" to "unsigned
> ch
> ar" may lose significant bits
> PUT32(len, target->rstart);
> ^
>
> "cc.c", line 85: remark #4235-D: conversion from "unsigned long" to "unsigned
> ch
> ar" may lose significant bits
> PUT32(len, target->rstart);
> ^
>
> "cc.c", line 85: remark #4235-D: conversion from "unsigned long" to "unsigned
> ch
> ar" may lose significant bits
> PUT32(len, target->rstart);
> ^
>
> "cc.c", line 112: remark #4235-D: conversion from "unsigned long" to "unsigne
> d c
> har" may lose significant bits
> PUT32(len, lenp);
> ^
>
> "cc.c", line 112: remark #4235-D: conversion from "unsigned long" to "unsigne
> d c
> har" may lose significant bits
> PUT32(len, lenp);
> ^
>
> "cc.c", line 112: remark #4235-D: conversion from "unsigned long" to "unsigne
> d c
> har" may lose significant bits
> PUT32(len, lenp);
> ^
>
> "cc.c", line 112: remark #4235-D: conversion from "unsigned long" to "unsigne
> d c
> har" may lose significant bits
> PUT32(len, lenp);
> ^
>
>
> ^
>
> "adb.c", line 1871: remark #2188-D: enumerated type mixed with another type
> return (result);
> ^
>
> "adb.c", line 1884: remark #2188-D: enumerated type mixed with another type
> return (result);
> ^
>
> "adb.c", line 2740: remark #2181-D: argument is incompatible with correspondi
> ng
> format string conversion
> fprintf(f, " [%s TTL %d]", legend, value - now);
> ^
>
> "adb.c", line 2842: remark #2181-D: argument is incompatible with correspondi
> ng
> format string conversion
> fprintf(f, " [ttl %d]", entry->expires - now);
> ^
>
> "adb.c", line 2849: remark #2181-D: argument is incompatible with correspondi
> ng
> format string conversion
> fprintf(f, " [lame TTL %d]\n", zi->lame_timer - now);
> ^
>
>
>
>
> "byaddr.c", line 104: remark #2181-D: argument is incompatible with correspon
> din
> g format string conversion
> (bytes[3] & 0xff),
> ^
>
> "byaddr.c", line 105: remark #2181-D: argument is incompatible with correspon
> din
> g format string conversion
> (bytes[2] & 0xff),
> ^
>
> "byaddr.c", line 106: remark #2181-D: argument is incompatible with correspon
> din
> g format string conversion
> (bytes[1] & 0xff),
> ^
>
> "byaddr.c", line 107: remark #2181-D: argument is incompatible with correspon
> din
> g format string conversion
> (bytes[0] & 0xff));
> ^
>
>
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I. -Iinclude -I/tmp/bind-9.3.2b2/li
> b/d
> ns/include -I../../lib/dns/include -I/tmp/bind-9.3.2b2/lib/isc/include -I.
> ./.
> ./lib/isc -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib
> /is
> c/pthreads/include -D_REENTRANT -DUSE_MD5 -DOPENSSL -D_XOPEN_SOURCE_EXTE
> NDE
> D -g +w1 +W 474,530,2193,2236 -c journal.c
> "include/dns/compress.h", line 48: remark #4227-D: padding struct to align "n
> ext
> "
> dns_compressnode_t *next;
> ^
>
> "include/dns/compress.h", line 60: remark #4227-D: padding struct to align "m
> ctx
> "
> isc_mem_t *mctx; /* Memory context. */
> ^
>
> "include/dns/fixedname.h", line 63: remark #4255-D: padding size of struct "d
> ns_
> fixedname" to alignment boundary
> struct dns_fixedname {
> ^
>
> "journal.c", line 545: remark #3348-D: declaration hides function "write" (de
> cla
> red at line 186 of "/usr/include/sys/unistd.h")
> journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t write,
> ^
>
> "journal.c", line 675: remark #3348-D: declaration hides function "write" (de
> cla
> red at line 186 of "/usr/include/sys/unistd.h")
> dns_journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t writ
> e,
> ^
>
> "rbtdb.c", line 3456: remark #4232-D: conversion from "dns_db_t *" to a more
> str
> ictly aligned type "dns_rbtdb64_t *" may cause misaligned access
> dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
> ^
>
> "rbtdb.c", line 3465: remark #2181-D: argument is incompatible with correspon
> din
> g format string conversion
> rbtnode, rbtnode->references, rbtnode->locknum);
> ^
>
> "rbtdb.c", line 3465: remark #2181-D: argument is incompatible with correspon
> din
> g format string conversion
> rbtnode, rbtnode->references, rbtnode->locknum);
> ^
>
> "rbtdb.c", line 3483: remark #2181-D: argument is incompatible with correspon
> din
> g format string conversion
> current->trust,
> ^
>
> "rbtdb.c", line 3484: remark #2181-D: argument is incompatible with correspon
> din
> g format string conversion
> current->attributes);
> ^
>
>
> cc -Ae -z -I/tmp/bind-9.3.2b2 -I../../../lib/tests/include -I/tmp
> /bin
> d-9.3.2b2/lib/isc/include -I../../../lib/isc -I../../../lib/isc/include -I
> ../
> ../../lib/isc/unix/include -I../../../lib/isc/pthreads/include -D_REENTRAN
> T
> -D_XOPEN_SOURCE_EXTENDED -g +w1 +W 474,530,2193,2236 -c t_timers.c
> "t_timers.c", line 111: remark #4238-D: conversion between enum type and poin
> ter
> type
> if ((isc_timertype_t) event->ev_arg == isc_timertype_ticker)
> ^
>
> "t_timers.c", line 314: remark #4238-D: conversion between enum type and poin
> ter
> type
> task, action, (void *)timertype,
> ^
>
>
>
--
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews at isc.org
More information about the bind-workers
mailing list