https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31893
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Daniel Fruzynski from comment #7) > void __attribute__((const)) func(int* i) > { > *i = 44; > } You get a warning because you marked this function const, which tells the compiler it won't modify *i, so you lied to the compiler. You should not be marking this function const.