Closed
Bug 146426
Opened 22 years ago
Closed 22 years ago
HP-UX IPF : fix compiler warning for +ESlit
Categories
(NSPR :: NSPR, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
4.2.1
People
(Reporter: jdunn, Assigned: netscape)
References
Details
(Keywords: fixedOEM)
Attachments
(1 file, 3 obsolete files)
1.68 KB,
patch
|
wtc
:
review+
|
Details | Diff | Splinter Review |
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.
Comment 2•22 years ago
|
||
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
Assignee | ||
Comment 3•22 years ago
|
||
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.
Assignee | ||
Comment 4•22 years ago
|
||
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 5•22 years ago
|
||
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+
Assignee | ||
Comment 6•22 years ago
|
||
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.
Comment 7•22 years ago
|
||
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?
Assignee | ||
Comment 8•22 years ago
|
||
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 9•22 years ago
|
||
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+
Assignee | ||
Comment 10•22 years ago
|
||
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
Comment 11•22 years ago
|
||
Reporter | ||
Comment 12•22 years ago
|
||
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 13•22 years ago
|
||
Comment on attachment 96071 [details] [diff] [review] OEM branch patch (both configure.in and configure) Never mind. Previous patch was correct.
Comment 14•22 years ago
|
||
Changes checked into OEM branch.
You need to log in
before you can comment on or make changes to this bug.
Description
•