This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] tile: Fix up corner cases with signed relocations


On Mon, 8 Sep 2014, Rich Felker wrote:

> > In any case, the GNU C language defines signed shifts (as long as the 
> > shift amount is >= 0 and < width of type), although it may still be useful 
> > to avoid the cases that are outside what ISO C defines.
> 
> I don't think this is true. For example, in many versions of GCC, this
> is (rightfully!) an infinite loop:
> 
> 	int i;
> 	for (i=1; i>0; i<<=1);

That would be a bug (I fixed such a bug ten years ago, PR 7284); please 
report it if present in trunk.  Signed shifts are documented in 
implement-c.texi; C90 makes some things implementation-defined even when 
C99/C11 make them undefined.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]