GNU bug report logs - #78903
[PATCH] ISO C99 does not support _Noreturn

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Thu, 26 Jun 2025 07:22:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 78903 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#78903: [PATCH] ISO C99 does not support _Noreturn
Date: Sat, 28 Jun 2025 00:07:02 -0700
[Message part 1 (text/plain, inline)]
On 2025-06-27 07:05, Helmut Eller wrote:
> The combination -Og -std=gnu99 -Wpedantic is
> usable; -Og -std=cc99 -Wpedantic produces fewer warnings though.  With
> -O0, both -std=gnu99 and -std=c99 produce too many warnings about
> statement expressions to be of any use.

You can suppress those statement-expression warnings by configuring this 
way:

  ./configure \
    CFLAGS='-O0 -std=c99 -Wpedantic' \
    emacs_cv_statement_expressions=no

I did that, and the resulting build generated several warnings about 
converting between function and data pointers that don't matter on any 
practical platform that I know of. I'm not sure it's worth the hassle to 
pacify GCC about them.

I did find a few other C99 violations, though, and fixed them by 
installing the attached patch.

Is it still important that Emacs port to C99? Perhaps we should upgrade 
the build requirement to C11 or later. It has been 14 years since C11, 
after all....


> I would place the 201112 <= STDC_VERSION test first and only if it fails
> fall back to __attribute__((__return__)).

Thanks for checking. I made the changes you suggested to Gnulib, and 
updated Emacs master from Gnulib. Please give it a try.
[0001-Port-varargs-macros-better-to-C99.patch (text/x-patch, attachment)]

This bug report was last modified 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.