diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-02-07 10:31:22 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-02-08 14:44:23 -0700 |
commit | 82728c33fe83d22b939bf6a82f2f0bbdc9b52a07 (patch) | |
tree | 4ba9465265a16ced2640f25ce1dc76aae015db5a /regen/embed.pl | |
parent | e42bd20440a10c098e7fba28bcad166baad5f2eb (diff) | |
download | perl-82728c33fe83d22b939bf6a82f2f0bbdc9b52a07.tar.gz |
regen/embed.pl: Warn if have > 1 i, p, and s flags
These should be mutually exclusive
Diffstat (limited to 'regen/embed.pl')
-rwxr-xr-x | regen/embed.pl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/regen/embed.pl b/regen/embed.pl index cbf421f313..629bb84f68 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"; } |