- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Alter the compilation flags on HP ANSI C (HP 1...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 07:15 AM
тАО07-28-2004 07:15 AM
Alter the compilation flags on HP ANSI C (HP 11.0)
I try to research about HP ANSI C Compiler warning. Our standard turn off all of the compiler warnings...
things like uninitialized variables, array boundary problems, unused variables....
the HP ANSI C compiler will show us all of this stuff rite? But i have to pass it the right flag.
Can someone help me on this?
Thank you
- Tags:
- suppress warnings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 07:37 AM
тАО07-28-2004 07:37 AM
Re: Alter the compilation flags on HP ANSI C (HP 11.0)
You can also suppress specific warnings using the +W warningnumber1,warningnumber2 argument.
Probably the safest is to run +w1 and then use +W n1,n2,n3 to suppress specific warnings that you deem to be "safe".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 08:27 AM
тАО07-28-2004 08:27 AM
Re: Alter the compilation flags on HP ANSI C (HP 11.0)
but it doesn't work for me when i tried +W1.
Here what i type:
first tried:
-DHP9000 -Aa +DAportable -g +W1
second tried:
-DHP9000 -Aa +DAportable -g +W1 +Ww1
third tried:
-DHP9000 -Aa +DAportable -g +W1 +Ww1 +y
It gave me same result..no warning..i expect it should raise something like uninitial variable..
Any idea?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 10:57 AM
тАО07-28-2004 10:57 AM
Re: Alter the compilation flags on HP ANSI C (HP 11.0)
However, uninitialized variables are not considered a warning and most C compilers do not emit code to do run-time array boundary checks. (That Microsoft Visual C++ thingy can do array-boundary checks.) The typical way to do array boundary checks is through assert()'s. Man assert for details. The tool that you really seem to be looking for is lint. Of course, my attitude is that array boundary excursions like memory leaks are the sole responsibility of the programmer and should never occur.
lint -s -p -Aa myfile.c
Man lint for more details.
This will find a number of questionable constructs like unused variables and/or functions but will not do array boundary checks (which would be meaningless at compile time) nor will it spot uninitialized variables because there is nothing wrong with them. Mind you, I almost always initialize variables (even auto storage class vaiables) but that is part of programmer discipline.
- Tags:
- lint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 02:53 AM
тАО07-29-2004 02:53 AM
Re: Alter the compilation flags on HP ANSI C (HP 11.0)
we used cc, not lint.
I think it have to be something in cc, but we dont' know yet.
Something is not a warning...but i dont know