When compiling zipl with GCC 11.2, I get a compiler warning that looks serious:
CC zipl/src/job.o
In function ‘set_cl_element’,
inlined from ‘get_ipl_components’ at job.c:580:7,
inlined from ‘finalize_ipl_address_data’ at job.c:788:7,
inlined from ‘check_job_ipl_data’ at job.c:883:9:
job.c:514:13: warning: argument 1 null where non-null expected [-Wnonnull]
514 | if (stat(filename, &stats)) {
| ^~~~~~
In file included from /usr/include/features.h:488,
from /usr/include/errno.h:25,
from job.c:13:
job.c: In function ‘check_job_ipl_data’:
/usr/include/sys/stat.h:227:12: note: in a call to function ‘stat’ declared ‘nonnull’
227 | extern int __REDIRECT_NTH (stat, (const char *restrict file,
| ^~~~~~
Looking at get_ipl_components() it seems to call set_cl_element() with filename == NULL indeed.
When compiling zipl with GCC 11.2, I get a compiler warning that looks serious:
CC zipl/src/job.o In function ‘set_cl_element’, inlined from ‘get_ipl_components’ at job.c:580:7, inlined from ‘finalize_ipl_address_data’ at job.c:788:7, inlined from ‘check_job_ipl_data’ at job.c:883:9: job.c:514:13: warning: argument 1 null where non-null expected [-Wnonnull] 514 | if (stat(filename, &stats)) { | ^
~~~~~ In file included from /usr/include/features.h:488, from /usr/include/errno.h:25, from job.c:13: job.c: In function ‘check_job_ipl_data’: /usr/include/sys/stat.h:227:12: note: in a call to function ‘stat’ declared ‘nonnull’ 227 | extern int __REDIRECT_NTH (stat, (const char *restrict file, | ^~~~~~Looking at get_ipl_components() it seems to call set_cl_element() with filename == NULL indeed.