Iain Hibbert | 12 Mar 2010 12:06

-Wsign-compare issues

Hi,
   Not sure if this is an issue or not. using -Wsign-compare with the
following code on with pcc/i386 produces two errors whereas I can't get
gcc to produce an error about it

void
test(int i, unsigned short u)
{
	if (i == u)
		;

	if (i == (u * 3))
		;

	if (i == (u * -2))
		;
}

I think in the first case, u is promoted to an int because all short
values can be represented by int, and this doesn't produce an error.

In the second case, u is promoted to an unsigned int during the
arithmetic, but then it cannot be promoted to an int since it might not
fit. I'm not completely sure if this is a bug or an implementation detail.

In the third case I think the same happens even though the multiplier is
explicitly signed and is more likely to be a bug.

I'm not sure if this is intentional or not, but because gcc does it
differently I'm not sure whether to just start adding casts to code that
(Continue reading)

Jordan Earls | 14 Mar 2010 19:27
Gravatar

Google Summer of Code

I am wondering if the pcc project will be applying to be a mentor in the Google Summer of Code. Anyone know if the coordinator of pcc is considering this?


Anders Magnusson | 15 Mar 2010 09:10
Picon

Re: Google Summer of Code

Jordan Earls wrote:
> I am wondering if the pcc project will be applying to be a mentor in 
> the Google Summer of Code. Anyone know if the coordinator of pcc is 
> considering this?
Considering yes, but it would take too much work to administer it, so 
I've avoided it.

...which doesn't mean that pcc hacking cannot be done as a SoC project 
under some other projects,
like NetBSD or OpenBSD, where pcc is included.

-- Ragge

Alt | 20 Mar 2010 02:06

Maybe I missed the memo on GCC compatibility

but what's the rationale for having GCC compatibility enabled by default?

Or better said: why can't GCC compatibility be disabled?

(I really trying not to start a flamefest. If this is a FAQ, please disregard.)

--

-- 
.alt.

Anders Magnusson | 21 Mar 2010 11:11
Picon

Re: Maybe I missed the memo on GCC compatibility

Alt wrote:
> but what's the rationale for having GCC compatibility enabled by default?
>   
Well, the world looks like that, if you install pcc then people tend to 
assume that they can
compile something with it :-)  Not having gcc compat would mean that the 
first thing you
need to do is to rewrite many of the system header files on your OS, and 
then change all
gcc-isms that are in the programs you may want to compile.  This is 
usually not what people
want to do when testing another compiler.

> Or better said: why can't GCC compatibility be disabled?
>   
Laziness.  gcc compat require changes to the yacc code, which is not 
easy to preprocess.
Also, some of the gcc extensions are needed to make the compiler usable 
on a specific
target, and instead of inventing it in a new way I just stick with the 
gcc way.

-- Ragge


Gmane