Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Statement expr inside of __assume incorrectly considered to have side-effects

$
0
0

I'm getting a ton of invalid warnings from ICC about an __assume with side effects.  It turns out the "problem" is that I'm using a statement expr (which has no side effects).  Here is a reduced test case:

#include <stdint.h>

void foo(int *bar) {
  __assume((
	    ((uintptr_t) bar)
	    % 16) == 0);

  __assume((
	    (__extension__ ({ (uintptr_t) bar; }))
	    % 16) == 0);
}

Which triggers:

aa.c(8): warning #2261: __assume expression with side effects discarded
    __assume((
             ^

I've already tweaked my code to get rid of the statement expr, so no need to think of work-arounds on my behalf.  I just wanted to report the issue.


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>