[SOLVED] A warning I want to avoid. GCC -Wpedantic
Posted: Tue Jun 24, 2014 8:14 pm
After many months of being in the dark without using a cross-compiler I have finally switched to GCC from DJGPP and am now compiling to ELF32-i386 with a MakeFile (yes finally I got a MakeFile)
So after getting all the warning flags set, I ended up having ~3000 warnings to start with went threw tediously fixing all of them, up until I got stuck.
I now have 6 warnings (2 in each of 3 files):
I have tried a few ways that did remove the warning, but unfortunately makes the code inoperable.
Anyone have any suggestions of how to avoid this?
Thanks
- Brian
So after getting all the warning flags set, I ended up having ~3000 warnings to start with went threw tediously fixing all of them, up until I got stuck.
I now have 6 warnings (2 in each of 3 files):
and the code refereed to is My IRQ ISR and INT handlers (which all are almost identical):SYSTEM/CPU/INT.c: In function ‘install_INT’:
SYSTEM/CPU/INT.c:21:16: warning: ISO C forbids assignment between function pointer and ‘void *’ [-Wpedantic]
.....IRSs[irq] = handler;
...................^
Code: Select all
void *ISRs[32] =
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
void install_ISR(uint8_t isr, void (*handler)(regs *r))
{
ISRs[isr] = handler;
}
void ISR_HANDLER(regs *r)
{
void (*ISR)(regs *r);
// Get ISRS Resolve Routine
ISR = ISRs[r->int_no];
// Do we have a valid Routine?
if (ISR)
ISR(r);
else
iError(r); // No Routine BSoD time.
}
Anyone have any suggestions of how to avoid this?
Thanks
- Brian