In general, I am pretty religious about writing software without any
warnings.
However, I recently wrote the following code:
#include <System\SysAll.h>
#include <UI\UIAll.h>
<snip>
static void PseudoFind2(FindParamsPtr params)
{
char dateString[longDateStrLength];
SystemPreferencesType prefs;
Byte month;
Byte day;
Word year;
month = 1;
day = 1;
year = 1999;
DateToAscii(month, day, year, prefs.longDateFormat, dateString);
<snip>
}
and got the following errors with GCC (cmmand line as follows):
m68k-palmos-coff-gcc -O1 -c -mdebug-labels -Wall -Wshadow -Wpointer-arith
-Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return
-Wstrict-prototypes prog.c -o prog.o
prog.c:441: warning: passing arg 1 of `DateToAscii' with different width due
to prototype
prog.c:441: warning: passing arg 2 of `DateToAscii' with different width due
to prototype
line 441 is the call to DateToAscii.
Has anybody an idea why I get these warnings ? I take care that I am passing
vairables of the same type as the documentation and the prototypes request.
I am using the headers of OS V3.1, where DateToAscii is defined as
void DateToAscii(Byte months, Byte days, Word years, DateFormatType
dateFormat, CharPtr pString)
SYS_TRAP(sysTrapDateToAscii);
In fact, I got a whole bunch of extra warnings coming out of the header
files: They are all related to functions which are defined as non-void, but
are declared with a SYS_TRAP. The typical warning is:
C:\PROGRA~1\PALMDE~1\lib\gcc-lib\m68k-palmos-coff/2.7.2.2-kgpd-071097/includ
e/Pa
lmOS/System/TextMgr.h: In function `TxtTransliterate':
C:\PROGRA~1\PALMDE~1\lib\gcc-lib\m68k-palmos-coff/2.7.2.2-kgpd-071097/includ
e/Pa
lmOS/System/TextMgr.h:274: warning: control reaches end of non-void function
Can anyone tell me if there is a way to get rid of these warnings without
getting rid of the checking in the non-SDK files (e.g. by adding some kind
of #pragma).
Thanks