[hatari-devel] Compiler warnings / system call

Thomas Huth huth at users.berlios.de
Sun Feb 28 17:31:42 CET 2010


When compiling the current hg tip, I get these compiler warnings:

/home/thomas/devel/hatari/master/src/debug/debugui.c: In function ‘DebugUI_Exec’:
/home/thomas/devel/hatari/master/src/debug/debugui.c:392: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
/home/thomas/devel/hatari/master/src/debug/debugui.c: In function ‘DebugUI_ParseFile’:
/home/thomas/devel/hatari/master/src/debug/debugui.c:956: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result

Eero, could you please fix them?

Also I have to say that I dislike the use of the system() call in
Hatari. First, I guess this call is quite specific to Unix-like
platforms, so we might run into problems on platforms that do not
feature a standard system shell and thus do not implement this call in
their C library.
Second, this could introduce possible security issues. On some systems,
Hatari might be installed as suid-root, so that it can for example
access the framebuffer device directly. Offering a system() call here
means to offer a root shell! So I vote for removing this debugger
commando again - or is it really required badly?

 Thomas



More information about the hatari-devel mailing list