Author Topic: va_list family functions missing in latest Ndless ?  (Read 5165 times)

0 Members and 1 Guest are viewing this topic.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
va_list family functions missing in latest Ndless ?
« on: November 05, 2014, 07:39:39 am »
Here's what make tells me when building the nKaruga source (online version slightly outdated, ask for precision if needed) :

(right after a make clean)
Code: [Select]
$ make
mkdir .depends
nspire-gcc -Wall -W -marm -Os -c main.cpp -MM -MF .depends/main.cpp.d
nspire-gcc -Wall -W -marm -Os -c Homing.cpp -MM -MF .depends/Homing.cpp.d
nspire-gcc -Wall -W -marm -Os -c PowerFragment.cpp -MM -MF .depends/PowerFragment.cpp.d
nspire-gcc -Wall -W -marm -Os -c DrawingCandidate.cpp -MM -MF .depends/DrawingCandidate.cpp.d
nspire-gcc -Wall -W -marm -Os -c ChainNotif.cpp -MM -MF .depends/ChainNotif.cpp.d
nspire-gcc -Wall -W -marm -Os -c ExplosionEffect.cpp -MM -MF .depends/ExplosionEffect.cpp.d
nspire-gcc -Wall -W -marm -Os -c Player.cpp -MM -MF .depends/Player.cpp.d
nspire-gcc -Wall -W -marm -Os -c Bullet.cpp -MM -MF .depends/Bullet.cpp.d
nspire-gcc -Wall -W -marm -Os -c Laser.cpp -MM -MF .depends/Laser.cpp.d
nspire-gcc -Wall -W -marm -Os -c buildGameLUTs.cpp -MM -MF .depends/buildGameLUTs.cpp.d
nspire-gcc -Wall -W -marm -Os -c DestroyedEnemies.cpp -MM -MF .depends/DestroyedEnemies.cpp.d
nspire-gcc -Wall -W -marm -Os -c DrawingCandidates.cpp -MM -MF .depends/DrawingCandidates.cpp.d
nspire-gcc -Wall -W -marm -Os -c BulletArray.cpp -MM -MF .depends/BulletArray.cpp.d
nspire-gcc -Wall -W -marm -Os -c EnemiesArray.cpp -MM -MF .depends/EnemiesArray.cpp.d
nspire-gcc -Wall -W -marm -Os -c BossEnemy.cpp -MM -MF .depends/BossEnemy.cpp.d
nspire-gcc -Wall -W -marm -Os -c Particles.cpp -MM -MF .depends/Particles.cpp.d
nspire-gcc -Wall -W -marm -Os -c Enemy.cpp -MM -MF .depends/Enemy.cpp.d
nspire-gcc -Wall -W -marm -Os -c utils.cpp -MM -MF .depends/utils.cpp.d
nspire-gcc -Wall -W -marm -Os -c ExplosionAnim.cpp -MM -MF .depends/ExplosionAnim.cpp.d
nspire-gcc -Wall -W -marm -Os -c n2DLib.c -MM -MF .depends/n2DLib.c.d
nspire-gcc -Wall -W -marm -Os -c n2DLib.c
n2DLib.c: In function ‘drawPolygon’:
n2DLib.c:492:2: erreur: unknown type name ‘va_list’
  va_list ap;
  ^
n2DLib.c:495:2: attention : implicit declaration of function ‘va_start’ [-Wimplicit-function-declaration]
  va_start(ap, nombreDePoints);
  ^
n2DLib.c:499:3: attention : implicit declaration of function ‘va_arg’ [-Wimplicit-function-declaration]
   cur_arg = va_arg(ap, int);
   ^
n2DLib.c:499:24: erreur: expected expression before ‘int’
   cur_arg = va_arg(ap, int);
                        ^
n2DLib.c:508:2: attention : implicit declaration of function ‘va_end’ [-Wimplicit-function-declaration]
  va_end(ap);
  ^
n2DLib.c: In function ‘drawStringF’:
n2DLib.c:661:2: erreur: unknown type name ‘va_list’
  va_list specialArgs;
  ^
n2DLib.c:666:2: erreur: incompatible type for argument 3 of ‘vsprintf’
  vsprintf(str, s, specialArgs);
  ^
In file included from /cygdrive/c/Users/Mattias/Documents/GitHub/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/sys-include/stdint.h:12:0,
                 from /cygdrive/c/Users/Mattias/Documents/GitHub/Ndless/ndless-sdk/toolchain/install/lib/gcc/arm-none-eabi/4.9.1/include/stdint.h:9,
                 from /cygdrive/c/Users/Mattias/Documents/GitHub/Ndless/ndless-sdk/bin/../include/libndls.h:36,
                 from n2DLib.h:4,
                 from n2DLib.c:1:
/cygdrive/c/Users/Mattias/Documents/GitHub/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/sys-include/stdio.h:189:5: note: expected ‘__gnuc_va_list’ but argument is of type ‘int’
 int _EXFUN(vsprintf, (char *, const char *, __VALIST)
     ^
Makefile:52: recipe for target 'n2DLib.o' failed
make: *** [n2DLib.o] Error 1
I only include <libndls.h> in n2DLib.h . Is it that libndls.h doesn't include stdarg.h ?

EDIT : yeah. Can someone delete this thread ?
« Last Edit: November 05, 2014, 07:51:55 am by Matrefeytontias »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: va_list family functions missing in latest Ndless ?
« Reply #1 on: November 05, 2014, 08:35:52 pm »
EDIT : yeah. Can someone delete this thread ?

Did you get this fixed and what was the issue if you did? (in case this can be useful to other people)

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: va_list family functions missing in latest Ndless ?
« Reply #2 on: November 05, 2014, 08:46:10 pm »
I asked ExtendeD about this, and said I had to include stdarg.h in my own files as some standards had changed. Now that I added #include <stdarg.h>, everything works fine.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: va_list family functions missing in latest Ndless ?
« Reply #3 on: November 06, 2014, 02:47:20 am »
Quote
I asked ExtendeD about this, and said I had to include stdarg.h in my own files as some standards had changed. Now that I added #include <stdarg.h>, everything works fine.
Yeah, it's considered bad code style to depend on other header files to include needed declarations for this reason.