Skip to content

Submit some fixes needed in Nixpkgs#202

Open
OPNA2608 wants to merge 3 commits intoAZO234:masterfrom
OPNA2608:submit-nixpkgs-fixes
Open

Submit some fixes needed in Nixpkgs#202
OPNA2608 wants to merge 3 commits intoAZO234:masterfrom
OPNA2608:submit-nixpkgs-fixes

Conversation

@OPNA2608
Copy link

There are further issues, but the fixes are less straight-forward (or I think the "easy" fixes are really bad). Hint: COMMON_C_CXX_FLAGS are not actually applied to C code, just C++ code.


CMAKE_CXX_FLAGS_DEBUG and CMAKE_CXX_FLAGS_RELEASE are currently a list of strings, due to how the quoting is done. This leads to a build failure whenever a C++ file gets compiled, due to the CMake list separator ; being interpreted as the end of the command.


The calls to TTF_GlyphMetrics (TTF_GetGlyphMetrics in SDL3) pass a pointer to an SDL_Surface where a 16-bit character code is expected. Likely a typo caused by super-short variable names, s instead of c.


The fgets call in /sdl/np2.c has the wrong parameter order - output location & length instead of length & location location.

…rings

g++ /* ... */ -O2 -Wall -DNDEBUG;-Wno-implicit-function-declaration -Wno-incompatible-pointer-types /* ... */ -o CMakeFiles/sdlnp2kai_sdl2.dir/sound/fmgen/fmgen_file.cpp.o -c /build/source/sound/fmgen/fmgen_file.cpp
ld: <glibc>/lib/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status
bash: line 1: -Wno-implicit-function-declaration: command not found
/build/source/sdl/fontmng.c:503:58: error: passing argument 2 of 'TTF_GlyphMetrics' makes integer from pointer without a cast [-Wint-conversion]
In file included from /build/source/sdl/fontmng.c:20:
<SDL2_ttf>/include/SDL2/SDL_ttf.h:800:69: note: expected 'Uint16' {aka 'short unsigned int'} but argument is of type 'SDL_Surface *'
/build/source/sdl/np2.c:373:19: error: passing argument 2 of 'fgets' makes integer from pointer without a cast [-Wint-conversion]
/build/source/sdl/np2.c:373:25: error: passing argument 3 of 'fgets' makes pointer from integer without a cast [-Wint-conversion]
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.

1 participant