[fpc-devel] libc bugreport

zephod zephod at skynet.be
Tue May 3 23:23:21 CEST 2005


Dear,

I am evaluating fpc as a possible replacement compiler for a large kylix based 
source tree (~200.000 lines of code). In porting the apps I encountered some 
small troubles:


* packages/base/libc/aineth.inc:
        inp argument of inet_aton should be var instead of in_addr pointer 
since the memory it refers to should exist and be valid at calling time. 
So why not let the compiler do the check for you?


* packages/base/libc/nudph.inc :
        typo in libc.pp. It includes the file nupdh.inc (notice the swap 
of 'p' and 'd' chars), which contains no code. Maybe it is best that 
nupdh.inc is moved to the attic to avoid future mistakes.


* packages/base/libc/nip.inc :
        iphdr and ip records have wrong size (24 bytes instead of 20). The 
first two C fields (version and ihl) are 4 bit integers contained in the 
first byte of the record.
        So instead of declaring flag0 as a word or dword, the type should 
be plain byte.


* What about send and recv calls in ssocketh.inc? The buffer could be an 
untyped var instead of a regular pointer (Giving nil as buffer argument, 
although not prohibited by libc, makes no sense imho)



kind regards,


Z.




More information about the fpc-devel mailing list