OpenOrbis / musl

A PS4 port of musl for the OpenOrbis PS4 Toolchain.
Other
34 stars 9 forks source link

Musl's open/open64 wrapper fails to build correctly #21

Closed sleirsgoevy closed 1 year ago

sleirsgoevy commented 2 years ago
In file included from src/fcntl/open.c:2:
src/fcntl/open.c: In function 'open':
src/fcntl/open.c:16:21: warning: 'mode_t' {aka 'short unsigned int'} is promoted to 'int' when passed through '...'
   16 |   mode = va_arg(ap, mode_t);
./include/stdarg.h:14:44: note: in definition of macro 'va_arg'
   14 | #define va_arg(v,l)     __builtin_va_arg(v,l)
      |                                            ^
src/fcntl/open.c:16:21: note: (so you should pass 'int' not 'mode_t' {aka 'short unsigned int'} to 'va_arg')
   16 |   mode = va_arg(ap, mode_t);
./include/stdarg.h:14:44: note: in definition of macro 'va_arg'
   14 | #define va_arg(v,l)     __builtin_va_arg(v,l)
      |                                            ^
src/fcntl/open.c:16:21: note: if this code is reached, the program will abort
   16 |   mode = va_arg(ap, mode_t);
./include/stdarg.h:14:44: note: in definition of macro 'va_arg'
   14 | #define va_arg(v,l)     __builtin_va_arg(v,l)
      |                                            ^

XXX: is this actually an upstream issue?

illusion0001 commented 1 year ago
TYPEDEF unsigned int mode_t;

Unsigned int fixed this warn since it's promoted to int but didn't test

illusion0001 commented 1 year ago

Fixed warn in #32