when I compile the following code, ep_bdt is not generated. I have to add the dummy function below to make it works.
It seems really strange : such a global variable could be used in an other module, so it has to be generated even if not used in the current module.
command used : sdcc -mpic16 -p18f4455 -c file.c
SDCC version : SDCC : pic16 2.6.1 #4471 (Nov 12 2006) (UNIX)
#include <pic18fregs.h>
/* Buffer descriptors Table */
volatile int __at (0x400) ep_bdt[32];
void dummy_function(void)
{
ep_bdt[0]; // makes the compiler happy !
}
It's still in SDCC 2.8.0. See also
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3037423&group_id=599
I'd like to point out (as the reporter of 3037423) that this problem doesn't always appear; I was only able to reproduce it when the variable:
- is an array, and
- is positioned with __at
as well as being unreferenced in the defining file