- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HP ANSI C Compiler and prototype checking
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
Forums
Discussions
Discussions
Discussions
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
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
09-21-2001 12:34 AM
09-21-2001 12:34 AM
HP ANSI C Compiler and prototype checking
I have a problem about the HP ANSI C compiler.
The product I installed is
B3901BA HP C/ANSI C Developer's Bundle for HP-UX 11.00(S800)
To avoid typo and other prototype inconsistence errors, I'd like to have the HP Ansi C compiler behaves like hp aCC compiler to enforce strict prototype checking.
I mean I'd like the following simple test program won't be compiled under HP ansi cc.
#include
int main(int argc, char **argv) {
printf("%d\n", sum(1,2));
}
int sum(int a, int b) {
return(a+b);
}
Since the function sum has no prototype. When compiles the same program using aCC, aCC reports the following:
Function 'sum' has not been defined yet; cannot call.
Is there any command line switch or directives for HP ANSI C compiler to do this?
Thanks in advance.
-Xiang ZHAO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2001 12:55 AM
09-21-2001 12:55 AM
Re: HP ANSI C Compiler and prototype checking
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2001 05:43 AM
09-21-2001 05:43 AM
Re: HP ANSI C Compiler and prototype checking
1) -Aa
2) -Ae
Hope this works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2001 06:05 AM
09-21-2001 06:05 AM
Re: HP ANSI C Compiler and prototype checking
Easy, add the +M flag to the command line.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2001 06:12 AM
09-21-2001 06:12 AM
Re: HP ANSI C Compiler and prototype checking
Have a look at the thread below. It may help.
http://docs.hp.com/hpux/onlinedocs/dev/aCC/a_05_30/otherlangs.htm
Hope this helps.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2001 06:28 AM
09-21-2001 06:28 AM
Re: HP ANSI C Compiler and prototype checking
Hi again,
I might as well give you the full syntax:
cc -Aa (or -Ae) +M +We 714 myfile.c
The +M enables ANSI migration warnings
The +We 714 promotes missing prototype warnings to an error. You can add other warning promotions +We 714,715,720 ...
That should do it though I would probably wrap all that in an include for your makefiles. You will probably have to intentionally make a few errors to get all the warnings promoted.
Most of the warnings are listed in
/opt/ansic/lib/nls/msg/C/cc.msgs.
Clay