From: Karl Williamson Date: Thu, 7 Feb 2013 17:31:22 +0000 (-0700) Subject: regen/embed.pl: Warn if have > 1 i, p, and s flags X-Git-Tag: upstream/5.20.0~4062 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82728c33fe83d22b939bf6a82f2f0bbdc9b52a07;p=platform%2Fupstream%2Fperl.git regen/embed.pl: Warn if have > 1 i, p, and s flags These should be mutually exclusive --- diff --git a/regen/embed.pl b/regen/embed.pl index cbf421f..629bb84 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -79,6 +79,13 @@ my ($embed, $core, $ext, $api) = setup_embed(); if (! $can_ignore && $retval eq 'void') { warn "It is nonsensical to require the return value of a void function ($plain_func) to be checked"; } + + my $scope_type_flag_count = 0; + $scope_type_flag_count++ if $flags =~ /s/; + $scope_type_flag_count++ if $flags =~ /i/; + $scope_type_flag_count++ if $flags =~ /p/; + warn "$plain_func: i, p, and s flags are all mutually exclusive" + if $scope_type_flag_count > 1; my $splint_flags = ""; if ( $SPLINT && !$commented_out ) { $splint_flags .= '/*@noreturn@*/ ' if $never_returns; @@ -95,8 +102,6 @@ my ($embed, $core, $ext, $api) = setup_embed(); else { $type = $1 eq 's' ? "STATIC" : "PERL_STATIC_INLINE"; } - warn "$plain_func: i and s flags are mutually exclusive" - if $flags =~ /s/ && $flags =~ /i/; $retval = "$type $splint_flags$retval"; $func = "S_$plain_func"; }