gcc wont compile code with ?: operator

Mark McGlone dmcglone at san.rr.com
Mon Feb 16 13:40:32 UTC 2004


On Mon, 2004-02-16 at 09:32, John V. Pope wrote:
> I was coding a simple C program and I found a bug in the gcc compiler.
> 
> The following code is a simple demonstration of the bug and should compile without errors:
> 
> 
> 		isprint(a[x]) ? b[x] = a[x]: b[x] = '.';

I don't think you can do an assignment like that. I think it should
be
  		b[x] = isprint(a[x]) ? a[x] : '.';





More information about the users mailing list