|
From: | address@hidden |
Subject: | Re: [lwip-users] std includes |
Date: | Wed, 13 Jul 2011 20:52:09 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 |
timmy brolin wrote:
In almost all lwIP *.c files, there are a couple of standard #includes at the top, just after the lwip #includes.Well, I don't think they feel misplaced: including them in sys.h or arch.h would include them in files which don't use them, which is not a good thing to do.Such as "#include <string.h>" and "#include <stdlib.h>". These feel misplaced.
I wouldn't have thought that this leads to problems on a standard C compiler. However, I do know of an AVR compiler that doesn't provide these files, so you might have a point in removing these includes, after all...? In sys.h anc arch.h the user may define user defined implementations of common functions, replacing the library functions.
If the standard libraries are to be included, then they should only be included from the user portable files sys.h or arch.h.
I'm not a friend of global "includeall.h" header files...
Can anyone come up with a reason why <string.h>, <stdlib.h>, <stddef.h> and <stdio.h> should not be removed from all *.c files?
See above: header files should be included where they are used. Anyone got any preferences on this? Simon
[Prev in Thread] | Current Thread | [Next in Thread] |