There is a warning about contents before sections, which doesn't work, since in_doc_sect variable is always true at the point it is checked. Drop the dead code.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -137,7 +137,6 @@ my $verbose = 0; · 136 unmodified lines | ||
| 137 | 137 | my $Werror = 0; |
| 138 | 138 | my $Wreturn = 0; |
| 139 | 139 | my $Wshort_desc = 0; |
| 140 | −my $Wcontents_before_sections = 0; | |
| 141 | 140 | my $output_mode = "rst"; |
| 142 | 141 | my $output_preformatted = 0; |
| 143 | 142 | my $no_doc_sections = 0; |
| @@ -223,7 +222,6 @@ use constant { · 79 unmodified lines | ||
| 223 | 222 | STATE_INLINE => 7, # gathering doc outside main block |
| 224 | 223 | }; |
| 225 | 224 | my $state; |
| 226 | −my $in_doc_sect; | |
| 227 | 225 | my $leading_space; |
| 228 | 226 | |
| 229 | 227 | # Inline documentation state |
| @@ -332,12 +330,9 @@ while ($ARGV[0] =~ m/^--?(.*)/) { · 102 unmodified lines | ||
| 332 | 330 | $Wreturn = 1; |
| 333 | 331 | } elsif ($cmd eq "Wshort-desc" or $cmd eq "Wshort-description") { |
| 334 | 332 | $Wshort_desc = 1; |
| 335 | − } elsif ($cmd eq "Wcontents-before-sections") { | |
| 336 | − $Wcontents_before_sections = 1; | |
| 337 | 333 | } elsif ($cmd eq "Wall") { |
| 338 | 334 | $Wreturn = 1; |
| 339 | 335 | $Wshort_desc = 1; |
| 340 | − $Wcontents_before_sections = 1; | |
| 341 | 336 | } elsif (($cmd eq "h") || ($cmd eq "help")) { |
| 342 | 337 | pod2usage(-exitval => 0, -verbose => 2); |
| 343 | 338 | } elsif ($cmd eq 'no-doc-sections') { |
| @@ -1963,7 +1958,6 @@ sub process_export_file($) { · 1619 unmodified lines | ||
| 1963 | 1958 | sub process_normal() { |
| 1964 | 1959 | if (/$doc_start/o) { |
| 1965 | 1960 | $state = STATE_NAME; # next line is always the function name |
| 1966 | − $in_doc_sect = 0; | |
| 1967 | 1961 | $declaration_start_line = $. + 1; |
| 1968 | 1962 | } |
| 1969 | 1963 | } |
| @@ -2068,7 +2062,6 @@ sub process_body($$) { · 98 unmodified lines | ||
| 2068 | 2062 | } |
| 2069 | 2063 | |
| 2070 | 2064 | if (/$doc_sect/i) { # case insensitive for supported section names |
| 2071 | − $in_doc_sect = 1; | |
| 2072 | 2065 | $newsection = $1; |
| 2073 | 2066 | $newcontents = $2; |
| 2074 | 2067 | |
| @@ -2085,14 +2078,10 @@ sub process_body($$) { · 10 unmodified lines | ||
| 2085 | 2078 | } |
| 2086 | 2079 | |
| 2087 | 2080 | if (($contents ne "") && ($contents ne "\n")) { |
| 2088 | − if (!$in_doc_sect && $Wcontents_before_sections) { | |
| 2089 | − emit_warning("${file}:$.", "contents before sections\n"); | |
| 2090 | − } | |
| 2091 | 2081 | dump_section($file, $section, $contents); |
| 2092 | 2082 | $section = $section_default; |
| 2093 | 2083 | } |
| 2094 | 2084 | |
| 2095 | − $in_doc_sect = 1; | |
| 2096 | 2085 | $state = STATE_BODY; |
| 2097 | 2086 | $contents = $newcontents; |
| 2098 | 2087 | $new_start_line = $.; |