- push( @nonnull, $n ) if ( $arg =~ s/\s*\bNN\b\s+// );
- $arg =~ s/\s*\bNULLOK\b\s+//; # strip NULLOK with no effect
+ my $nn = ( $arg =~ s/\s*\bNN\b\s+// );
+ push( @nonnull, $n ) if $nn;
+
+ my $nullok = ( $arg =~ s/\s*\bNULLOK\b\s+// ); # strip NULLOK with no effect
+
+ # Make sure each arg has at least a type and a var name.
+ # An arg of "int" is valid C, but want it to be "int foo".
+ my $temp_arg = $arg;
+ $temp_arg =~ s/\*//g;
+ $temp_arg =~ s/\s*\bstruct\b\s*/ /g;
+ if ( ($temp_arg ne "...") && ($temp_arg !~ /\w+\s+\w+/) ) {
+ warn "$func: $arg doesn't have a name\n";
+ }
+ if ( $SPLINT && $nullok && !$commented_out ) {
+ $arg = '/*@null@*/ ' . $arg;
+ }