Skip to content

Conversation

@lowlyw
Copy link

@lowlyw lowlyw commented Mar 24, 2023

Description

build on macos was failing due to -Wpointer-sign -Werror

previously:

make
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/config.c -o src/config.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/glsl_shader.c -o src/glsl_shader.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/main.c -o src/main.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/opengl.c -o src/opengl.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_80.c -o src/sm_80.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_81.c -o src/sm_81.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_82.c -o src/sm_82.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_84.c -o src/sm_84.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_85.c -o src/sm_85.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_86.c -o src/sm_86.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_87.c -o src/sm_87.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_88.c -o src/sm_88.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_89.c -o src/sm_89.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_8b.c -o src/sm_8b.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_8d.c -o src/sm_8d.o
cc -c -O2 -fno-strict-aliasing -Werror  -I/opt/local/include/SDL2 -D_THREAD_SAFE -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I. src/sm_8f.c -o src/sm_8f.o
src/sm_8f.c:518:10: error: passing 'uint8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Werror,-Wpointer-sign]
  strcpy((uint8 *)&room_main_asm_variables[2], "@");
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:27: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
src/sm_8f.c:519:10: error: passing 'uint8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Werror,-Wpointer-sign]
  strcpy((uint8 *)&room_main_asm_variables[6], " ");
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:27: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
src/sm_8f.c:640:10: error: passing 'uint8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Werror,-Wpointer-sign]
  strcpy((uint8 *)room_main_asm_variables, "\"");
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:27: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
src/sm_8f.c:641:10: error: passing 'uint8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Werror,-Wpointer-sign]
  strcpy((uint8 *)&room_main_asm_variables[2], "<");
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:27: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
src/sm_8f.c:662:12: error: passing 'uint8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Werror,-Wpointer-sign]
    strcpy((uint8 *)room_main_asm_variables, "\b");
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:27: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
src/sm_8f.c:687:12: error: passing 'uint8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Werror,-Wpointer-sign]
    strcpy((uint8 *)room_main_asm_variables, "*");
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:27: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
src/sm_8f.c:704:12: error: passing 'uint8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Werror,-Wpointer-sign]
    strcpy((uint8 *)room_main_asm_variables, "*");
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:27: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
7 errors generated.
make: *** [src/sm_8f.o] Error 1

Will this Pull Request break anything?

probably not

Suggested Testing Steps

shouldn't be functionally any different

@MarieKirya
Copy link

This also fixed a macOS build as well! 👍

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