For the code added in day 328, I've been trying to understand why gcc won't create usable code, it doesn't seem to like "va_list" pointers like ArgList.
The gcc error:
| src/handmade_shared.h: In function ‘umm FormatStringList(umm, char*, char*, __va_list_tag*)’:
src/handmade_shared.h:388:84: error: cannot convert ‘__va_list_tag**’ to ‘__va_list_tag (*)[1]’
for argument ‘2’ to ‘s64 ReadVarArgSignedInteger(u32, __va_list_tag (*)[1])’
s64 Value = ReadVarArgSignedInteger(IntegerLength, &ArgList);
|
First it changes the (va_list *) type to (__va_list_tag *), I guess with a macro or something, but "__va_list_tag" isn't a real type, (it is built into gcc), so I can't cast to it. I can cast to (va_list *) and it will compile, but it will crash with a segmentation fault when I try to open "Profile" in the debug menu.
I'm not sure how to cast to a type with a [1] in it, does it mean an array of length 1? Does it need the length information or can you replace the [1] with an * in the cast? I couldn't get a cast to work with any form of [1] in it.
By not passing "ArgList" by reference, but by value, I can get it to compile and run normally, so I can only guess that gcc is doing something strange that prevents passing a "va_list" by reference.
I've included a
link to the compiling/running mod in case it's unclear.
Thanks in advance to anyone who's more familiar with this stuff.