Bennugd Void * Issues As Type Members And Function Return Types

sam fisher

Well-Known Member
Apr 11, 2004
Bristol, UK
I've recently started looking at BennuGD and got to the point where it would be convenient to have a linked list. So, I've tried to implement a generic linked list using void * for the stored items but this has led to a couple of issues.

Firstly, I couldn't get the code to compile with a type containing a void * element but I managed to work around this by first defining a type containing nothing by a void element. I have no idea why this worked and since the compiler error was a syntax / parsing error I can think of no good reason why this should work :S.

Secondly, I have not managed to successfully compile code that contains a function that returns a void * and I've tried an analogous work around to the above, defining a function returning type void, but that didn't work. Currently I'm working around this by returning an int * and doing some nasty type cast mangling but I don't think I should need to do this.

Has anyone else run into similar issues to these?
Which compiler are you using? I compiled a small example with gcc 4.7.2 and had no issues:
class CTest
  : m_number(0),
  int m_number;
  void* m_pointer;

void* MyFun(int i)
  return 0;

int main (int argc, char* argv[])
  CTest myTest;
  return 0;

Can you give a minimum example that doesn't work for you?
I can successfully compile bennugd on the OMAP5 devboard as I ported Streets of Rage Remake not too long ago for the Pyra.

gcc version.
gcc (Debian 6.3.0-18) 6.3.0 20170516

I do see some Warnings:
In file included from moddesc.c:27:0:
/mnt/120g/trashy_dev/bennugd-code/tools/moddesc/../../core/include/loadlib.h:84:12: warning: ‘dlibclose’ defined but not used [-Wunused-function]
 static int dlibclose( void * _handle )
/mnt/120g/trashy_dev/bennugd-code/tools/moddesc/../../core/include/loadlib.h:57:15: warning: ‘dliberror’ defined but not used [-Wunused-function]
 static char * dliberror( void )

I'm not using anything spectacular for compiling flags either.
 CFLAGS=" -mcpu=cortex-a15 -mfpu=neon -mfloat-abi=hard -funroll-loops -L/usr/lib/arm-linux-gnueabihf/ -L/opt/omap5-sgx-ddk-um-linux/lib -lcrypto -ldl"