Now that all of the warnings at -Wall -Wextra have been addressed and -Werror turned on, it is time to consider is there is anything flagged by -pedantic that we want to address. Pedantic warnings can also be for things that we actually do not want to fix. But this needs discussion. This topic is for doing that.
The report on unique pedantic warning instances as it started is:
Warnings by Type
=================================
3 -Wc++20-extensions
78 -Wvariadic-macros
83 -Woverflow
134 -Wpointer-arith
339 -Wformat=
619 -Wpedantic
Total: 1256
Extra Semicolon from SPIN_DECLARE
MR 1058 addressed cases there were “extra semicolon in struct or union specified” from the use of SPIN_DECLARE with a semi-colon at the end. The macro is documented as users should not follow its use by a semi-colon because it generates nothing in some configurations.
Obsolete Structure Field Initializers
The next class of warnings that should be addressed are "obsolete use of designated initializer with ‘:’ ". There are 57 of these across all BSPs and this is an example:
VMEDmaListClassRec vmeTsi148DmaListClass = {
desc_size: sizeof(VmeTsi148DmaListDescriptorRec),
The appropriate syntax for this example is:
VMEDmaListClassRec vmeTsi148DmaListClass = {
.desc_size = sizeof(VmeTsi148DmaListDescriptorRec),
Zero Length Arrays
There are 93 warnings for zero length arrays. These are forbidden by ISO C per the warning. These are good candidates to address.
bsps/include/grlib/gr1553rt.h:96:24: warning: ISO C forbids zero-size array ‘bds’ [-Wpedantic]
Per GCC documentation we should be using flexible array members (FAM) which are part of the C standard. This is a simple source code change from [0] to [] but there needs to be a bit of research to confirm that the semantics are the same and sizeof on the structure returns the same value.