GNU bug report logs - #36370
27.0.50; XFIXNAT called on negative numbers

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Tue, 25 Jun 2019 05:37:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

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

Bug is archived. No further changes may be made.

Full log


Message #81 received at 36370 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pip Cet <pipcet <at> gmail.com>
Cc: 36370 <at> debbugs.gnu.org, bug-gnulib <at> gnu.org, Bruno Haible <bruno <at> clisp.org>
Subject: Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers
Date: Fri, 28 Jun 2019 22:41:02 -0700
Pip Cet wrote:
>    eassume (global == 0);
>    eassume (f ());
> #else
>    eassume (global == 0 && f ());
> ...
> extern int global;
> 
> int f(void)
> {
>    return ++global;
> }


This is not a valid use of 'assume'. It's documented that assume's argument 
should be free of side effects.

It would be nice if 'assume (R)' reported an error if R has side effects, and 
generated a warning unless the compiler can verify that R is free of side 
effects. However, these niceties would require better support from the compiler.

> If you want your program to behave predictably, in the strict sense,
> you cannot ever use the current assume() API.

I'm not sure what you mean by "in the strict sense". It's true that programs can 
misuse 'assume' and get undefined behavior, but that's kind of the point....




This bug report was last modified 6 years and 20 days ago.

Previous Next


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