Skip to content

Commit f10851d

Browse files
authored
posix.cfg: erand48/nrand48/jrand48 fixed argument direction (#5253)
1 parent 265759d commit f10851d

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

cfg/posix.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
21972197
<leak-ignore/>
21982198
<use-retval/>
21992199
<returnValue type="long int"/>
2200-
<arg nr="1" direction="in">
2200+
<arg nr="1" direction="inout">
22012201
<not-null/>
22022202
<not-uninit/>
22032203
<not-bool/>
@@ -2209,7 +2209,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
22092209
<leak-ignore/>
22102210
<use-retval/>
22112211
<returnValue type="long int"/>
2212-
<arg nr="1" direction="in">
2212+
<arg nr="1" direction="inout">
22132213
<not-null/>
22142214
<not-uninit/>
22152215
<not-bool/>
@@ -2221,7 +2221,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
22212221
<leak-ignore/>
22222222
<use-retval/>
22232223
<returnValue type="double"/>
2224-
<arg nr="1" direction="in">
2224+
<arg nr="1" direction="inout">
22252225
<not-null/>
22262226
<not-uninit/>
22272227
<not-bool/>

test/cfg/posix.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,13 @@ double nullPointer_erand48(unsigned short xsubi[3])
330330
return erand48(xsubi);
331331
}
332332

333+
struct non_const_parameter_erand48_struct { unsigned short xsubi[3]; };
334+
// No warning is expected that dat can be const
335+
double non_const_parameter_erand48(struct non_const_parameter_erand48_struct *dat)
336+
{
337+
return erand48(dat->xsubi);
338+
}
339+
333340
unsigned short *nullPointer_seed48(unsigned short seed16v[3])
334341
{
335342
// cppcheck-suppress nullPointer

0 commit comments

Comments
 (0)