From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Subject: Re: error logs RE: compiling X with ccc
Date: Mon, 11 Mar 2002 17:49:44 -0700 [thread overview]
Message-ID: <20020311174944.A7347@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <ODEEIIAMNNHHFAMGOBAPIEOJCAAA.voodoo@alphadriven.org>; from voodoo@alphadriven.org on Mon, Mar 11, 2002 at 05:24:27PM -0500
On Mon, Mar 11, 2002 at 05:24:27PM -0500, Peter Petrakis wrote:
> cc: Info: imake.c, line 1610: In this statement, the unsigned expression
> "fwrite(...)" is being compared with an equality operator to a constant
> whose value is negative. This might not be what you intended.
> (questcompare1)
> if (fwrite(buf, sizeof(char), cnt, fd) == -1)
> ------------^
Picky, picky! But C compiler is supposed to do a type promotion.
'fwrite' indeed has a return type size_t so you can do
if (fwrite(buf, sizeof(char), cnt, fd) == (size_t)(-1))
if you want to avoid this whining.
> cc: Info: imake.c, line 259: This top level include file appears to be
> unused. (unusedtop)
> #include <stdio.h>
> -^
This is weird. So from where they picked up a declartion of 'fwrite'?
It _should_ be in <stdio.h>. Anyway, this is a compiler
overenthusiastic on warnings and format of these is a gret PITA if
you work from Unix editors and want a help with positioning your cursor.
> imake.o: In function `get_libc_version':
> :1010: undefined reference to `alloca'
> :1010: undefined reference to `alloca'
> :1010: undefined reference to `alloca'
'make -Dalloca=malloc' or add this define to your compilation flags.
This will create leaks so if ccc _really_ does not provide 'alloca'
(this is really a compiler dependent as this is an allocation on stack
but carefuly check ccc docs) then for anything running longer, like X,
you will have to fix sources. Great fun as that means that you have to
track every possible way to exit callers.
'alloca()' is faster, and quietly frees your memory, although it allows
you to mess up your stack quite effectively. :-)
Michal
next prev parent reply other threads:[~2002-03-12 0:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-11 19:43 compiling X with ccc Peter Petrakis
2002-03-11 22:24 ` error logs " Peter Petrakis
2002-03-11 23:30 ` Uncle George
2002-03-12 0:24 ` Peter Petrakis
2002-03-12 1:25 ` Uncle George
2002-03-12 1:36 ` Peter Petrakis
2002-03-12 2:42 ` Uncle George
2002-03-12 1:30 ` W Bauske
2002-03-12 1:50 ` Uncle George
2002-03-12 1:56 ` Uncle George
2002-03-12 0:23 ` W Bauske
2002-03-12 0:49 ` Michal Jaegermann [this message]
2002-03-12 1:33 ` yeah baby :-) " Peter Petrakis
2002-03-12 2:06 ` Uncle George
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox