Closed Bug 146426 Opened 22 years ago Closed 22 years ago

HP-UX IPF : fix compiler warning for +ESlit

Categories

(NSPR :: NSPR, defect, P2)

HP
HP-UX
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jdunn, Assigned: netscape)

References

Details

(Keywords: fixedOEM)

Attachments

(1 file, 3 obsolete files)

I get the following warning when compiling NSPR on HP's IPF

warning 952: The +ESlit option works in this release, but 
is deprecated. Use +Olit=all instead.
We should add a configure test for the +Olit=all compiler
flag rather than testing whether the cpu is ia64.

Chris, could you take care of this?  Is there an autoconf
macro for testing if a compiler option is supported?  When
using HP's compiler on HP-UX, we want to use +Olit=all if
it's supported or +ESlit otherwise.
Assignee: wtc → seawood
Priority: -- → P2
Target Milestone: --- → 4.2.1
There's not a specifc autoconf test for testing compiler flags.  You could just
add the flag to CFLAGS and use standard AC_TRY_COMPILE test.  However, if your
compiler is fairly lenient about accepting invalid flags (like gcc is), then
you'll have to resort to manual testing like we do when checking for -pthread.

cc only throws a warning when given an invalid flag so we have to manually do
the check.
Attachment #84752 - Attachment is obsolete: true
Comment on attachment 94543 [details] [diff] [review]
add compile check for +Olit support

r=wtc.

So AC_TRY_COMPILE fails if there is a compiler warning?
Attachment #94543 - Flags: review+
No, that's the problem.  HPUX's cc ignores any unknown compiler flags and exits
the compile with the normal status of zero.  AC_TRY_COMPILE doesn't know
anything about the various compiler nuances; instead it just checks the return
status. It sees the zero status and thinks that the build succeeded.  IMO, the
compiler should have thrown an error and exited with a non-zero status.  
I'm confused.  Your patch is using AC_TRY_COMPILE,
but HP-UX's cc exits with the normal status of zero
when an unknown compiler flag is specified.  So how
does your patch work?
Doh! I switched trees when testing the patch and I attached the original patch
from my main tree out of habit.
Attachment #94543 - Attachment is obsolete: true
Comment on attachment 94578 [details] [diff] [review]
Correct patch that greps for warnings

r=wtc.

Instead of grepping for 'unrecognize' or 'unknown',
perhaps the test should fail if the compiler writes
*any* output to stdout or stderr.

Another idea is to test the compiler version.  But
that'll require consulting the documentation or HP
for the exact version of the compiler that +Olit=all
first appeared in.
Attachment #94578 - Flags: review+
Patch has been checked into the NSPR trunk and the NSPRPUB_PRE_4_2_CLIENT_BRANCH
tag.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Whiteboard: branchOEM+
Blocks: 136163
Comment on attachment 96071 [details] [diff] [review]
OEM branch patch (both configure.in and configure)

use previous patch
not this one
Attachment #96071 - Attachment is obsolete: true
Comment on attachment 96071 [details] [diff] [review]
OEM branch patch (both configure.in and configure)

Never mind.  Previous patch was correct.
Changes checked into OEM branch. 
Whiteboard: branchOEM+ → branchOEM+, fixedOEM
Keywords: fixedOEM
Whiteboard: branchOEM+, fixedOEM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: