You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling vgm2x on macOS, the compilation fails due to undefined PATH_MAX
MechBook:vgm2x donluca$ make
gcc -MMD -c vgm2x.c -o vgm2x.o -Wall -ggdb -I/usr/local/include
vgm2x.c:54:15: error: use of undeclared identifier 'PATH_MAX'
char rpath[PATH_MAX]; // FIXME: maybe allocate n...
^
vgm2x.c:141:14: error: use of undeclared identifier 'PATH_MAX'
char fmfile[PATH_MAX];
^
vgm2x.c:288:22: error: use of undeclared identifier 'PATH_MAX'
char writable_path[PATH_MAX];
^
vgm2x.c:304:56: warning: format specifies type 'unsigned long' but the argument
has type 'zip_uint64_t' (aka 'unsigned long long') [-Wformat]
...fprintf(stderr, "Could not allocate %lu bytes\n", st.size);
~~~ ^~~~~~~
%llu
vgm2x.c:314:61: warning: format specifies type 'unsigned long' but the argument
has type 'zip_uint64_t' (aka 'unsigned long long') [-Wformat]
...fprintf(stderr, "Could not read %lu bytes from zip\n", st.size);
~~~ ^~~~~~~
%llu
vgm2x.c:329:15: error: use of undeclared identifier 'PATH_MAX'
char base[PATH_MAX];
^
vgm2x.c:353:13: error: use of undeclared identifier 'PATH_MAX'
char base[PATH_MAX];
^
2 warnings and 5 errors generated.
PATH_MAX on macOS is 1024 bytes as per
MechBook:vgm2x donluca$ grep PATH_MAX /usr/include/sys/syslimits.h*
#define PATH_MAX 1024 /* max bytes in pathname */
After defining PATH_MAX inside vgm2x.c the program compiles, but when ran it crashes with the following error:
MechBook:vgm2x donluca$ ./vgm2x ~/Downloads/26\ -\ Emerald\ Hill\ \(2P\).vgz -m OPM
vgm2x(52766,0x7fffa4f70380) malloc: *** error for object 0x7ffee155af00: pointer being realloc'd was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
Tested on macOS High Sierra 10.13.6
The text was updated successfully, but these errors were encountered:
donluca
changed the title
vgm2x fails to compile due to missing PATH_MAX and crashes when defined manually
vgm2x fails to compile on macOS due to missing PATH_MAX and crashes when defined manually
Oct 20, 2024
When compiling vgm2x on macOS, the compilation fails due to undefined PATH_MAX
PATH_MAX on macOS is 1024 bytes as per
After defining PATH_MAX inside vgm2x.c the program compiles, but when ran it crashes with the following error:
Tested on macOS High Sierra 10.13.6
The text was updated successfully, but these errors were encountered: