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,14 +256,6 @@ 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 /\b NN\b // );
268
260
my $nz = ( $arg =~ s /\b NZ\b // );
269
261
my $nullok = ( $arg =~ s /\b NULLOK\b // );
@@ -274,6 +266,25 @@ sub generate_proto_h {
274
266
$arg =~ s /\s +$// ;
275
267
$arg =~ s /\s {2,}/ / g ;
276
268
269
+ die_at_end " :$func : $arg Use only one of NN, NULLOK, and NZ"
270
+ if 0 + $nn + $nz + $nullok > 1;
271
+
272
+ push ( @nonnull , $n ) if $nn ;
273
+
274
+ # A non-pointer shouldn't have a pointer-related modifier.
275
+ # But typedefs may be pointers without our knowing it, so
276
+ # we can't check for non-pointer issues. We can only
277
+ # check for the case where the argument is definitely a
278
+ # pointer.
279
+ if ($args_assert_line && $arg =~ / \* / ) {
280
+ if ($nn + $nullok == 0) {
281
+ warn " $func : $arg needs NN or NULLOK\n " ;
282
+ ++$unflagged_pointers ;
283
+ }
284
+
285
+ warn " $func : $arg should not have NZ\n " if $nz ;
286
+ }
287
+
277
288
push ( @nonnull , $n ) if $nn ;
278
289
279
290
# 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