Skip to content

cppcheckexecutor.cpp: avoid -Wcast-qual warnings on macOS#7749

Merged
chrchr-github merged 1 commit intodanmar:mainfrom
firewave:qual-mac
Aug 18, 2025
Merged

cppcheckexecutor.cpp: avoid -Wcast-qual warnings on macOS#7749
chrchr-github merged 1 commit intodanmar:mainfrom
firewave:qual-mac

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

/Users/runner/work/cppcheck/cppcheck/cli/cppcheckexecutor.cpp:746:9: error: cast from 'const int *' to 'int *' drops const qualifier [-Werror,-Wcast-qual]
  746 |     if (WIFEXITED(res)) {
      |         ^
[  2%] Building CXX object lib/CMakeFiles/cppcheck-core.dir/symboldatabase.cpp.o
/Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/sys/wait.h:152:26: note: expanded from macro 'WIFEXITED'
  152 | #define WIFEXITED(x)    (_WSTATUS(x) == 0)
      |                          ^
/Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/sys/wait.h:136:26: note: expanded from macro '_WSTATUS'
  136 | #define _WSTATUS(x)     (_W_INT(x) & 0177)
      |                          ^
/Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/sys/wait.h:131:34: note: expanded from macro '_W_INT'
  131 | #define _W_INT(w)       (*(int *)&(w))  /* convert union wait to int */
      |                                  ^

```
/Users/runner/work/cppcheck/cppcheck/cli/cppcheckexecutor.cpp:746:9: error: cast from 'const int *' to 'int *' drops const qualifier [-Werror,-Wcast-qual]
  746 |     if (WIFEXITED(res)) {
      |         ^
[  2%] Building CXX object lib/CMakeFiles/cppcheck-core.dir/symboldatabase.cpp.o
/Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/sys/wait.h:152:26: note: expanded from macro 'WIFEXITED'
  152 | #define WIFEXITED(x)    (_WSTATUS(x) == 0)
      |                          ^
/Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/sys/wait.h:136:26: note: expanded from macro '_WSTATUS'
  136 | #define _WSTATUS(x)     (_W_INT(x) & 0177)
      |                          ^
/Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/sys/wait.h:131:34: note: expanded from macro '_W_INT'
  131 | #define _W_INT(w)       (*(int *)&(w))  /* convert union wait to int */
      |                                  ^
```
@sonarqubecloud
Copy link
Copy Markdown

@chrchr-github chrchr-github merged commit 921d893 into danmar:main Aug 18, 2025
63 checks passed
@firewave firewave deleted the qual-mac branch August 18, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants