|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||
|
|||
|
Re: How to detect unresolved references at compile time?
Assuming a unix like shell
Code:
powerpc-wrs-vxworks-readelf -s FRC_UserProgram.out A simple filter for them (not exact, you also only need worry about GLOBAL syms, not LOCAL ones). Code:
powerpc-wrs-vxworks-readelf -s FRC_UserProgram.out | grep UND Code:
powerpc-wrs-vxworks-readelf -s FRC_UserProgram.out \
| awk '{ if ($5 == "GLOBAL" && $7 == "UND") print $8 }'
Potentially you could construct a list of symbols provided by vxworks (adding new ones that your code uses as needed), filter those out, and if any are left produce an error in your build scripts. The following shows how to filter out known vxworks symbols (assuming you list them, 1 per line, in vxworks_syms.txt): Code:
powerpc-wrs-vxworks-readelf -s FRC_UserProgram.out \
| awk '{ if ($5 == "GLOBAL" && $7 == "UND") print $8 }' \
| grep -vFf vxworks_syms.txt
Edit: also, sorry that this is not quite compile time . I can't help you there (though -Wmissing-prototypes helps)Last edited by codes02 : 21-02-2013 at 17:58. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|