File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -256,19 +256,30 @@ sub generate_proto_h {
256
256
unless $has_mflag ;
257
257
}
258
258
else {
259
- if ( $args_assert_line
260
- && $arg =~ / \* /
261
- && $arg !~ / \b (NN|NULLOK)\b / )
262
- {
263
- warn " $func : $arg needs NN or NULLOK\n " ;
264
- ++$unflagged_pointers ;
265
- }
266
-
267
259
my $nn = ( $arg =~ s /\s *\b NN\b\s +// );
268
260
my $nz = ( $arg =~ s /\s *\b NZ\b\s +// );
269
261
my $nullok = ( $arg =~ s /\s *\b NULLOK\b\s +// );
270
262
my $nocheck = ( $arg =~ s /\s *\b NOCHECK\b\s +// );
271
263
264
+ die_at_end " :$func : $arg Use only one of NN, NULLOK, and NZ"
265
+ if 0 + $nn + $nz + $nullok > 1;
266
+
267
+ push ( @nonnull , $n ) if $nn ;
268
+
269
+ # A non-pointer shouldn't have a pointer-related modifier.
270
+ # But typedefs may be pointers without our knowing it, so
271
+ # we can't check for non-pointer issues. We can only
272
+ # check for the case where the argument is definitely a
273
+ # pointer.
274
+ if ($args_assert_line && $arg =~ / \* / ) {
275
+ if ($nn + $nullok == 0) {
276
+ warn " $func : $arg needs NN or NULLOK\n " ;
277
+ ++$unflagged_pointers ;
278
+ }
279
+
280
+ warn " $func : $arg should not have NZ\n " if $nz ;
281
+ }
282
+
272
283
push ( @nonnull , $n ) if $nn ;
273
284
274
285
# Make sure each arg has at least a type and a var name.
You can’t perform that action at this time.
0 commit comments