> The first occurs because .o is generated from .adb:
>     CFLAGS missing (-Wformat -Werror=format-security): gcc-6 -c -I./ 
> -I../progs -g -O2 -fPIE -fstack-protector-strong -gnat2005 -gnato -gnatVa 
> -fstack-check -gnatw.I -I- -o /«PKGBUILDDIR»/build/objects/arm_frm.o 
> /«PKGBUILDDIR»/progs/arm_frm.adb
> I assume it's fine to ignore -Wformat* here. Is this correct?

Exactly. Ada uses no format strings, so -Wformat and
-Werror=format-security have no effect when compiling Ada sources.  We
actually remove them to avoid a repeated noisy GCC warning.

> The second appears is the following two lines:
>     CFLAGS missing (-Wformat -Werror=format-security): gcc-6 -c -I./ 
> -I../progs -g -O2 -fPIE -fstack-protector-strong -gnat2005 -gnato -gnatVa 
> -fstack-check -I- -x ada -o /«PKGBUILDDIR»/build/objects/arm_form.o 
> /«PKGBUILDDIR»/progs/arm_form.ada
>     CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc-6 -c -I./ -I../progs -g -O2 
> -fPIE -fstack-protector-strong -gnat2005 -gnato -gnatVa -fstack-check -I- -x 
> ada -o /«PKGBUILDDIR»/build/objects/arm_form.o 
> /«PKGBUILDDIR»/progs/arm_form.ada

> I don't know what .ada is used for. Can I treat it like .adb with
> the same flag restrictions? How should CPPFLAGS be treated?

I missed this one, *.ada sources are quite rare nowadays in Debian.
There is no analog of the C preprocessor in Ada.

Here is what should be implemented:
When * the source file name matches "*.ad[abs]",
  or * the command line contains " -x ada ",
we are compiling an Ada source.
Then * no CPPFLAGS should be used at all,
     * all CFLAGS should be used, but "-Wformat" and "-Werror=format-security"

Reply via email to