This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Suggestion required for appropriate implementation


Hi All,

I want to add command line options in GCC for analyzing application code
for a set of rules. These options would generate warnings against the
violated rules. I would like to give user provision of analyzing code
for:-
1. Generating warnings for all the rules.
2. Enabling warning only for a particular rule.
3. Disabling warning for a particular rule.

Please suggest me which of the following two approaches is appropriate
in order to get approval from FSF.

Approach 1:
Since these options are warning options, I intend to integrate them with
standard '-W' options of GCC. Doing so would by default give the user
provision of suppressing warning for a particular rule by using '-Wno'.

For e.g.:
1. If the user wants to analyze code for all rules, then he can do that
by using '-Wanalyze' option.
2. If the user wants to analyze code for only rule 1, then he can do
that by using '-Wanalyze-Rule1' option.
3. If the user wants to analyze code for all rules except rule 1, then
he can do that by using '-Wanalyze' option followed by
'-Wno-analyze-Rule1' option.

This approach will add command line options equal to the number of
rules.
Kindly suggest whether adding so many options would be appropriate.
In order to avoid these many options, I would like to change the syntax
to '-Wanalyze-Rule=<rule number>'. Doing so would add only 1 command
line option but it is not possible to have similar syntax for
suppressing warning by using '-Wno-analyze-Rule=<rule number>'. 
Please confirm my understanding on the same.

Approach 2:
In order to overcome the drawback mentioned in the first approach, I
intend to have a completely different syntax of command line option.
This approach too will generate warnings against violated rules but the
command line options will be completely independent of standard GCC '-W'
options.
 
For e.g.:
1. If the user wants to analyze code for all rules, then he can do that
by using 'analyze-all' option.
2. If the user wants to analyze code for only rule 1, then he can do
that by using 'enable-analyze-rule=1' option.
3. If the user wants to analyze code for all rules except rule 1, then
he can do that by using 'analyze-all' option followed by
'disable-analyze-rule=1' option.

I feel this approach is appropriate because this would add only 3
command line options whereas the number of command line options in first
approach would be equal to the number of rules.
Kindly suggest me which approach is appropriate and also your comments
on the same in view of getting it approved by FSF.

Regards,
Rahul Phalak
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH, H8, R8C, M16C
and M32C Series. The following site also offers free technical support
to its users. Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on June 1, 2006.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]