2015-06-09 01:00 AM
I'm getting the following message from my compiler:
warning: ''__packed'' redefined [enabled by default] which is defined in the usb_conf.h file from the USB_OTG library, and in the cdefs.h file from the gcc. Any ideas how to get rid of the message?2015-06-09 01:40 AM
The root cause is that ST blatantly violates C99 7.1.3#1 (both ''All identifiers that begin with an underscore [...] are always reserved'' clauses) in all their libraries (and for that matter, ARM does the same in the CMSIS files it supplies). Here, they are partially innocent - the library had been apparently developed for the ARM compiler, and the redifinitions stem from attempt for a cheap porting.
The real solution is to manually rewrite all __packed in the whole library for a name allowed in user namespace, e.g. PACKED (making sure it's an unique name of course). This is something ST ought to do really, so if you are in position they listen to you (i.e. you represent the >1M buying power), please push them to do so for others' benefit. The quick and dirty solution is to attempt to suppress the warning in command line, but as it's ''enabled by default'' it may be not a trivial undertaking - try to browse the warnings part of gcc documentation. JW