CMFSUPPORT-3977 : COVERITY TEST. DO NOT MERGE#15
Conversation
There was a problem hiding this comment.
Pull request overview
This PR appears to be a Coverity-oriented test change for MsgBusTestServer, adding a diagnostic fprintf and altering build flags to avoid format warnings being treated as errors.
Changes:
- Added a
fprintf(stderr, ...)line inssp_main.c(currently with a format-string issue). - Added
-Wno-error=formattoMsgBusTestServerbuild flags inMakefile.am.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| source/MsgBusTestServer/ssp_main.c | Adds a stderr log statement in main() (currently introduces a format mismatch). |
| source/MsgBusTestServer/Makefile.am | Adjusts compiler flags to stop treating format warnings as errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| DmErr_t err; | ||
| debugLogFile = stderr; | ||
|
|
||
| fprintf(stderr, "Test coverity %s \n"); |
There was a problem hiding this comment.
This fprintf uses a "%s" format specifier but does not provide a corresponding argument. That is undefined behavior and will be flagged by compilers with -Wformat; either remove the "%s" or pass the intended string argument (and consider dropping the extra space before the newline).
| fprintf(stderr, "Test coverity %s \n"); | |
| fprintf(stderr, "Test coverity\n"); |
| AM_CFLAGS += -Wno-error=format | ||
|
|
There was a problem hiding this comment.
Adding -Wno-error=format disables treating format-string issues as errors for this target and can mask real bugs (including the new fprintf format mismatch). It would be safer to fix the offending format string(s) and keep format warnings as errors; if this is only needed for a specific analysis build, consider gating it behind a dedicated configure option/env var rather than always in AM_CFLAGS.
| AM_CFLAGS += -Wno-error=format |
| DmErr_t err; | ||
| debugLogFile = stderr; | ||
|
|
||
| fprintf(stderr, "Test coverity %s \n"); |
There was a problem hiding this comment.
Coverity Issue - Missing argument to printf format specifier
No argument for format specifier "%s".
Medium Impact, CWE-685
PRINTF_ARGS
| DmErr_t err; | ||
| debugLogFile = stderr; | ||
|
|
||
| fprintf(stderr, "Test coverity %s \n"); |
There was a problem hiding this comment.
Coverity Issue - Printf arg count mismatch
the format string requires additional arguments
Medium Impact, CWE-685
PW.TOO_FEW_PRINTF_ARGS
|
Close test pr |
DO NOT MERGE