sheredom / subprocess.h

🐜 single header process launching solution for C and C++
The Unlicense
1.1k stars 97 forks source link

Silence -Wcast-qual warnings showing up with newer version of g++. #87

Closed hporten closed 3 months ago

hporten commented 3 months ago

Somewhen between gcc 11 and a 14 pre-release, g++ started to complain about the C-style casts:

subprocess.h: In function ‘int subprocess_create_ex(const char const, int, const char const, subprocess_s)’: subprocess.h:877:27: warning: cast from type ‘const char const’ to type ‘char const’ casts away qualifiers [-Wcast-qual] 877 | (char const *)commandLine, used_environment)) { | ^~~~~~

The pragmas for clang should not be needed anymore.

hporten commented 3 months ago

Redid the first version after the CI system revealed: the pragmas were needed after all.

sheredom commented 3 months ago

I might tidy that up later and put them into the const cast itself as pragmas - might be a little neater! But LGTM, will merge once green.