/[autoconf]/autoconf/lib/Autom4te/ChannelDefs.pm
ViewVC logotype

Diff of /autoconf/lib/Autom4te/ChannelDefs.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by akim, Wed Aug 20 06:51:34 2003 UTC revision 1.2 by akim, Thu Aug 21 16:15:40 2003 UTC
# Line 27  Autom4te::ChannelDefs - channel definiti Line 27  Autom4te::ChannelDefs - channel definiti
27    
28    use Autom4te::ChannelDefs;    use Autom4te::ChannelDefs;
29    
30    Autom4te::ChannelDefs::usage ();    print Autom4te::ChannelDefs::usage (), "\n";
31    prog_error ($MESSAGE, [%OPTIONS]);    prog_error ($MESSAGE, [%OPTIONS]);
32    error ($WHERE, $MESSAGE, [%OPTIONS]);    error ($WHERE, $MESSAGE, [%OPTIONS]);
33    error ($MESSAGE);    error ($MESSAGE);
# Line 36  Autom4te::ChannelDefs - channel definiti Line 36  Autom4te::ChannelDefs - channel definiti
36    verb ($MESSAGE, [%OPTIONS]);    verb ($MESSAGE, [%OPTIONS]);
37    switch_warning ($CATEGORY);    switch_warning ($CATEGORY);
38    parse_WARNINGS ();    parse_WARNINGS ();
39    parse_warning ($OPTION, $ARGUMENT);    parse_warnings ($OPTION, $ARGUMENT);
40    Autom4te::ChannelDefs::set_strictness ($STRICTNESS_NAME);    Autom4te::ChannelDefs::set_strictness ($STRICTNESS_NAME);
41    
42  =head1 DESCRIPTION  =head1 DESCRIPTION
# Line 80  Errors related to GNU Standards. Line 80  Errors related to GNU Standards.
80    
81  =item C<error-gnu/warn>  =item C<error-gnu/warn>
82    
83  Errors related to GNU Standards that should be warnings in `foreign' mode.  Errors related to GNU Standards that should be warnings in "foreign" mode.
84    
85  =item C<error-gnits>  =item C<error-gnits>
86    
# Line 90  Errors related to GNITS Standards (silen Line 90  Errors related to GNITS Standards (silen
90    
91  Internal errors.  Use C<&prog_error> to send messages over this channel.  Internal errors.  Use C<&prog_error> to send messages over this channel.
92    
93    =item C<cross>
94    
95    Constructs compromising the cross-compilation of the package.
96    
97  =item C<gnu>  =item C<gnu>
98    
99  Warnings related to GNU Coding Standards.  Warnings related to GNU Coding Standards.
# Line 142  register_channel 'automake', type => 'fa Line 146  register_channel 'automake', type => 'fa
146               "####################\n"),               "####################\n"),
147    footer => "\nPlease contact <bug-automake\@gnu.org>.";    footer => "\nPlease contact <bug-automake\@gnu.org>.";
148    
149    register_channel 'cross', type => 'warning', silent => 1;
150  register_channel 'gnu', type => 'warning';  register_channel 'gnu', type => 'warning';
151  register_channel 'obsolete', type => 'warning', silent => 1;  register_channel 'obsolete', type => 'warning', silent => 1;
152  register_channel 'override', type => 'warning', silent => 1;  register_channel 'override', type => 'warning', silent => 1;
# Line 158  register_channel 'note', type => 'debug' Line 163  register_channel 'note', type => 'debug'
163    
164  =item C<usage ()>  =item C<usage ()>
165    
166  Display warning categories.  Return the warning category descriptions.
167    
168  =cut  =cut
169    
170  sub usage ()  sub usage ()
171  {  {
172    print "Warning categories include:    return "Warning categories include:
173      `cross'         cross compilation issues
174    `gnu'           GNU coding standards (default in gnu and gnits modes)    `gnu'           GNU coding standards (default in gnu and gnits modes)
175    `obsolete'      obsolete features or constructions    `obsolete'      obsolete features or constructions
176    `override'      user redefinitions of Automake rules or variables    `override'      user redefinitions of Automake rules or variables
# Line 174  sub usage () Line 180  sub usage ()
180    `all'           all the warnings    `all'           all the warnings
181    `no-CATEGORY'   turn off warnings in CATEGORY    `no-CATEGORY'   turn off warnings in CATEGORY
182    `none'          turn off all the warnings    `none'          turn off all the warnings
183    `error'         treat warnings as errors    `error'         treat warnings as errors";
 ";  
184  }  }
185    
186  =item C<prog_error ($MESSAGE, [%OPTIONS])>  =item C<prog_error ($MESSAGE, [%OPTIONS])>
# Line 234  sub verb ($;%) Line 239  sub verb ($;%)
239  =item C<switch_warning ($CATEGORY)>  =item C<switch_warning ($CATEGORY)>
240    
241  If C<$CATEGORY> is C<mumble>, turn on channel C<mumble>.  If C<$CATEGORY> is C<mumble>, turn on channel C<mumble>.
242  If it's C<no-mumble>, turn C<mumble> off.  If it is C<no-mumble>, turn C<mumble> off.
243  Else handle C<all> and C<none> for completeness.  Else handle C<all> and C<none> for completeness.
244    
245  =cut  =cut
# Line 293  sub parse_WARNINGS () Line 298  sub parse_WARNINGS ()
298      }      }
299  }  }
300    
301  =item C<parse_warning ($OPTION, $ARGUMENT)>  =item C<parse_warnings ($OPTION, @ARGUMENT)>
302    
303  Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>.  Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>.
304    
305  C<$OPTIONS> is C<"--warning"> or C<"-W">, C<$ARGUMENT> is C<CATEGORY>.  C<$OPTIONS> is C<"--warning"> or C<"-W">, C<@ARGUMENT> is a list of
306    C<CATEGORY>.
307    
308  This is meant to be used as a argument to C<Getopt>.  This can be used as a argument to C<Getopt>.
309    
310  =cut  =cut
311    
312  sub parse_warnings ($$)  sub parse_warnings ($@)
313  {  {
314    my ($opt, $categories) = @_;    my ($opt, @categories) = @_;
315    
316    foreach my $cat (split (',', $categories))    foreach my $cat (map { split ',' } @categories)
317      {      {
318        msg 'unsupported', "unknown warning category `$cat'"        msg 'unsupported', "unknown warning category `$cat'"
319          if switch_warning $cat;          if switch_warning $cat;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26