Suppressing compiler warning on Debian 12/gcc 12.2.0

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Suppressing compiler warning on Debian 12/gcc 12.2.0
Дата
Msg-id ZPDpFRfJe9TCY4AC@momjian.us
обсуждение исходный текст
Ответы Re: Suppressing compiler warning on Debian 12/gcc 12.2.0  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Being a new user of Debian 12/gcc 12.2.0, I wrote the following shell
script to conditionally add gmake rules with compiler flags to
src/Makefile.custom to suppress warnings for certain files.  This allows
me to compile all supported Postgres releases without warnings.

I actually didn't how simple it was to add per-file compile flags until
I read:

    https://stackoverflow.com/questions/6546162/how-to-add-different-rules-for-specific-files

---------------------------------------------------------------------------

# PG 14+ uses configure.ac
if [ ! -e configure.in ] || grep -q 'AC_INIT(\[PostgreSQL\], \[13\.' configure.in
then    cat >> src/Makefile.custom <<END
# work around gcc -O1 bug found in PG 13-current, not -O[023], 2023-08-28
# https://www.postgresql.org/message-id/ZOz3cBySkbEA5RN+@momjian.us
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111240
# gmake fix:  https://stackoverflow.com/questions/6546162/how-to-add-different-rules-for-specific-files
clauses.o: CFLAGS+=-O2
END
fi

if [ -e configure.in ] && grep -q 'AC_INIT(\[PostgreSQL\], \[11\.' configure.in
then    cat >> src/Makefile.custom <<END
# new warning in Debian 12, gcc (Debian 12.2.0-14) 12.2.0, 2023-08-14
# Fix for valid macro using stack_base_ptr, warning only in PG 11
postgres.o: CFLAGS+=-Wdangling-pointer=0
END
fi

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Andrey M. Borodin"
Дата:
Сообщение: Re: UUID v7
Следующее
От: Corey Huinker
Дата:
Сообщение: Re: Document efficient self-joins / UPDATE LIMIT techniques.