On Sat, 14 Dec 2024 18:34:03 -0500
David Malcolm <[email protected]> wrote:
> You may want to apply this trivial fix to placate older C++ compilers:
>
> diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc
> index c9f146df41f..af4efcecebb 100644
> --- a/gcc/cobol/genapi.cc
> +++ b/gcc/cobol/genapi.cc
> @@ -15077,8 +15077,8 @@ move_helper(tree size_error, // This
> is an INT
> static tree stash = gg_define_variable(UCHAR_P, "..mh_stash",
> vs_file_static);
> - tree st_data;
> - tree st_size;
> + tree st_data = NULL_TREE;
> + tree st_size = NULL_TREE;
>
> if( restore_on_error )
> {
>
> ...since otherwise the build might fail on a bootstrap build (which
> IIRC uses -Werror on the later stages).
Applied, and thanks.
Somewhat astray of the subject, but I'm confused about -Werror. When I
bulid gcc, I configure with
CFLAGS = -g3 -O0 -std=c11
partly out of fun, because I know c11 is not a requirement. That
produces a boatload of warnings, for example that the 1st argument to
printf is not a constant.
When I asked gcc what the canonical warning options are -- i.e, what
options are expected to be used and still produce a warning-free build
-- the answer was "-W". I took that to mean that the effort of pursuing
warning-free code is not deemed worthwhile.
Are all warnings equal, or some more equal than others?
--jkl