Re: [xml] compiler warnings from HP ANSI C on HP-UX 11iv2 (11.23)

Bjorn Reese wrote:
Rick Jones wrote:

Attached to this message is the typescript of a compile with +w1 and +M2 set to enable all the warnings the compiler sees fit to emit. They seem to be similar to those emitted by the HP-UX 11i v1 (11.11) compilers but with nicer message text. This was also with +DD64 set to get a 64-bit compile.

6 of the warnings are for trionan.c, which is my domain.

All 6 warnings can safely be ignored. I use explicit casts, but that
does not appear to satisfy the compiler.

I suspect it may be getting overly paranoid about the possible alignment of the components. IMO it seems silly to warn about casting a pointer from something with stricter alignment to one with looser alignment - such as the one for line 181 in your code. Of course, compilers can be strange and mysterious things. I'll have to tap my compiler contact's on the shoulder and ask them about it.

I know that these warnings can be ignored by adding the +W1036 compiler
option, but I am wondering if it possible to put this instruction into
the source code, e.g. in the form of a pragma. I looked through the HP
aC++ manual, but found nothing obvious.

Then again, maybe I am overreacting here. Are the above warning level
part of the normal build, or did you change it to see if the compiler
would find some potential problems in the code? (Some of them, like
the assignment of long to int, are definitely work looking at.)

The warnings are _not_ part of a normal build - I can see where I probably should have used a differently worded subject... Without either of +w1 (more or less the equivalent of gcc -Wall) or +M2 they are not emitted by the compiler. So, when someone does ./configure and then make they will not see these. If they do CFLAGS="+w1 +M2" ./configure and then make they will. I suspect that only compulsive nitpickers :) will be setting those options.

I'm passing them along only for completeness and on the off chance they are pointing-out possible future trouble spots. Some of the stuff about pointer math being given to an int rather than a long for example.

rick jones

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]