[ ant-contrib-Bugs-1775873 ] Sunpro Forte compiler can't set warning level to default
"SourceForge.net" <[email protected]> Thu, 16 Aug 2007 13:12:35 -0700
| Newsgroups | gmane.comp.java.ant-contrib.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #1775873, was opened at 2007-08-16 13:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1775873&group_id=36177
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: cpptasks
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Curt Arnold (carnold)
Summary: Sunpro Forte compiler can't set warning level to default
Initial Comment:
>From Michael Micucci: micucci at roguewave dot com:
In the Sunpro Forte-specific code:
public void addWarningSwitch(Vector args, int level) {
switch (level) {
case 0 :
args.addElement("-w");
break;
case 1 :
case 2 :
args.addElement("+w");
break;
case 3 :
case 4 :
case 5 :
args.addElement("+w2");
break;
}
}
This means there is no way to have a compile line without either +w, +w2, or -w. For the CC compiler, the default setting is not to specify any of these. This will print out regular warnings. To specify +w will result in more warnings than the default level, however the 'default' level in cc-task (which is level '2') adds the +w flag, which is incorrect. I also cannot workaround this since I can only use "compilerarg" to ADD compiler arguments, not remove them.
I propose the following code instead:
public void addWarningSwitch(Vector args, int level) {
switch (level) {
case 0 :
args.addElement("-w");
break;
case 1 :
case 2 :
break;
case 3 :
args.addElement("+w");
break;
case 4 :
case 5 :
args.addElement("+w2");
break;
}
}
This will allow 'severe' and 'default' warnings levels to use the default warning levels for the compiler, while the 'production' level will use "+w" which is one level higher than default and 'debug' and 'aserror' level can still use "+w2" which will result in a large number of warning conditions. I can also see having 'production' (case 3) result in no arguments and 'debug' (case 4) resulting in +w, with only 'aserror' (case 5) using the +w2 flag.
Thanks!
-- Michael Micucci - micucci at roguewave dot com
-- Senior Software Developer, Roguewave Software
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1775873&group_id=36177
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/