Skip to content

Commit d8c8b21

Browse files
committed
regen/embed.pl: A,C and either [EX] flags are mutually exclusive
It makes no sense to specify more than one of A C X, nor more than one of A C E. This commit enforces that, showing one entry in embed.fnc that needed to be changed.
1 parent 3d75a04 commit d8c8b21

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

embed.fnc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,7 @@ Cp |const char *|moreswitches \
20742074
Adp |void |mortal_destructor_sv \
20752075
|NN SV *coderef \
20762076
|NULLOK SV *args
2077-
CRTXip |char * |mortal_getenv |NN const char *str
2077+
CRTip |char * |mortal_getenv |NN const char *str
20782078
Cdp |void |mortal_svfunc_x|SVFUNC_t f \
20792079
|NULLOK SV *p
20802080
Adop |const struct mro_alg *|mro_get_from_name \

regen/embed.pl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ sub generate_proto_h {
143143
warn "It is nonsensical to require the return value of a void function ($plain_func) to be checked";
144144
}
145145

146+
my $has_E_or_X = $flags =~ /[EX]/;
147+
if ($has_E_or_X + ($flags =~ tr/AC//) > 1) {
148+
die_at_end "$plain_func: A, C, and either E or X flags are"
149+
. " mutually exclusive";
150+
}
151+
146152
die_at_end "$plain_func: S and p flags are mutually exclusive"
147153
if $flags =~ tr/Sp// > 1;
148154
if ($has_mflag) {

0 commit comments

Comments
 (0)