From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier To: Ralph Loader Cc: gcc@gcc.gnu.org Subject: Re: [Tiny patch] builtin_constant_p improvement. Date: Fri, 04 Aug 2000 06:13:00 -0000 Message-id: <20000804151302.B8999@pcep-jamie.cern.ch> References: <14729.54163.779907.515622@sucky.fish> X-SW-Source: 2000-08/msg00107.html Just as well, because Glibc assumes this does work. See strlen, . -- Jamie Ralph Loader wrote: > The enclosed patch causes the following (recently posted) code to > return 1 when compiled as C code. (It already does when compiled as > C++). It removes an assumption that pointers can only be constant if > they are literals. > > inline int f (const char *const s) > { > if (__builtin_constant_p (s)) > return 1; > else > return 0; > } > > int g () > { > return f ("abc"); > }