From f10851dc372163baccea8845c03123a574b5c3d5 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 27 Jul 2023 07:50:46 +0200 Subject: [PATCH] posix.cfg: erand48/nrand48/jrand48 fixed argument direction (#5253) --- cfg/posix.cfg | 6 +++--- test/cfg/posix.c | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index f07f8fe8b..7cde306a3 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -2197,7 +2197,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s - + @@ -2209,7 +2209,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s - + @@ -2221,7 +2221,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s - + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 3da495953..0621e9836 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -330,6 +330,13 @@ double nullPointer_erand48(unsigned short xsubi[3]) return erand48(xsubi); } +struct non_const_parameter_erand48_struct { unsigned short xsubi[3]; }; +// No warning is expected that dat can be const +double non_const_parameter_erand48(struct non_const_parameter_erand48_struct *dat) +{ + return erand48(dat->xsubi); +} + unsigned short *nullPointer_seed48(unsigned short seed16v[3]) { // cppcheck-suppress nullPointer