[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "make distcheck" fails

From: Bruno Haible
Subject: Re: "make distcheck" fails
Date: Sun, 12 Jul 2020 02:21:32 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

> > I can reproduce it on an Ubuntu 16.04.x machine:
> > m4.c:166:1: error: function might be candidate for attribute 'pure' if it 
> > is known to return normally [-Werror=suggest-attribute=pure]
> >   fault_handler (int signo)
> >   ^
> ...
> > It is not clear to me whether the function 'fault_handler' should be
> > marked with attribute 'pure' or not.
> 'pure' does sound dicey, as the intent is for 'pure' to be useful to a 
> compiler 
> when doing optimization and it's satisfying that intent, but on the other 
> hand 
> the function does have side effects visible to the caller.

I was hesitating as well, until I read the first sentence in the description
of 'pure':
  "Calls to functions that have no observable effects on the state of the 
   other than to return a value..."
Evidently _exit(1) is a side effect (the biggest side effect a function can 
So, 'fault_handler' should not be marked 'pure'.

> Anyway, GCC 10.1 doesn't issue the diagnostic for me, I hope because GCC has 
> been improved since the GCC 5 that comes with Ubuntu 16.04.

Right, it's corrected in GCC 8 or newer.

> So I hope we can 
> leave this alone, as we can assume that whoever prepares m4 distributions has 
> a 
> more-modern GCC.

OK. I've switched the weekly tarball generator [2] to use Ubuntu 20.04; it
contains a GCC >= 8.


[2] https://gitlab.com/gnu-m4/ci-distcheck

reply via email to

[Prev in Thread] Current Thread [Next in Thread]