|
|
Up |
|
|
  |
Author: Morris DoveyMorris Dovey Date: May 6, 2008 10:33
About a week ago, I downloaded Jacob's lcc package to my new (to me)
Win/XP box and gave it a test drive this morning. The application
program reads my web server's log file (currently about 35MB) and
reduces it to a bunch of lists, then outputs the log contents arranged
by each requestor's chronological list of hits. It's not really a
strenuous test, but there's plenty of opportunity to screw up multiple
levels of indirection, etc.
The program was originally written on a Linux system and compiled/linked
using the gcc toolchain.
With the "pedantic" option it warned (8 times) about "Assignment within
a conditional expression" but was otherwise friendly. The executable was
some larger than I recollected the gcc version had been, but shrank by
8KB when I used the -O (peephole optimizer) option. I think that puts
the size in the same ballpark with the gcc-compiled (with -O3) version.
The only other C compiler I have for my current environment is TurboC
V3.0 - an old friend, but not always convenient in current MS platforms.
Unless I discover a particular need to use TC3 (or discover some
horrible in lcc), I'll probably stick with lcc.
|
| Show full article (1.49Kb) |
|
| | 97 Comments |
|
  |
Author: Tomás Ó hÉilidheTomás Ó hÉilidhe Date: May 6, 2008 10:41
On May 6, 6:33Â pm, Morris Dovey iedu.com> wrote:
> The executable was
> some larger than I recollected the gcc version had been, but shrank by
> 8KB when I used the -O (peephole optimizer) option.
Did you strip the executable, i.e. take out all the superfluous shite
that isn't needed? When using gcc, here's what I do to get a lean
executable:
gcc hello.c -D NDEBUG -ansi -pedantic -S -O3 -o hello.exe
It gave me an executable of 397 bytes for the follow program:
#include
int main(void)
{
puts("Hello World!");
return 0;
}
|
| |
|
| | no comments |
|
  |
Author: Morris DoveyMorris Dovey Date: May 6, 2008 11:02
Tomás Ó hÉilidhe wrote:
> Did you strip the executable, i.e. take out all the superfluous shite
> that isn't needed?
I don't remember, but I'll check when I'm next on that machine (it's 16
miles from here at my shop). I've liked using gcc on the Linux box - and
expect that I'll enjoy using lcc on this one.
|
| |
| no comments |
|
  |
Author: Antoninus TwinkAntoninus Twink Date: May 6, 2008 11:10
On 6 May 2008 at 17:41, Tomás Ó hÉilidhe wrote:
> Did you strip the executable, i.e. take out all the superfluous shite
> that isn't needed?
Yeah, gotta hate all that superfluous shite that does absolutely nothing
except let you debug your program.
|
| |
| no comments |
|
  |
Author: Keith ThompsonKeith Thompson Date: May 6, 2008 11:19
Morris Dovey iedu.com> writes:
> About a week ago, I downloaded Jacob's lcc package to my new (to me)
> Win/XP box and gave it a test drive this morning.
[...]
jacob's compiler is called "lcc-win". "lcc" is a different compiler
(the one on which lcc-win was based). It's an important distinction.
[...]
> With the "pedantic" option it warned (8 times) about "Assignment
> within a conditional expression" but was otherwise friendly.
Such a warning seems perfectly friendly to me. Would you prefer that
it didn't tell you that you might have mistyped "==" as "="?
[snip]
--
Keith Thompson (The_Other_Keith) mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
|
| |
| no comments |
|
  |
Author: Morris DoveyMorris Dovey Date: May 6, 2008 11:21
Antoninus Twink wrote:
> On 6 May 2008 at 17:41, Tomás Ó hÉilidhe wrote:
>> Did you strip the executable, i.e. take out all the superfluous shite
>> that isn't needed?
>
> Yeah, gotta hate all that superfluous shite that does absolutely nothing
> except let you debug your program.
I don't much worry about it. Since loading Red Hat's v4.1 on the shop
computer, I've run gdb exactly once - because I thought I should try it
out for the experience (just in case).
Never needed it. Still - it's there if the need does arise.
|
| |
| no comments |
|
  |
Author: jacob naviajacob navia Date: May 6, 2008 11:26
Morris Dovey wrote:
> About a week ago, I downloaded Jacob's lcc package to my new (to me)
> Win/XP box and gave it a test drive this morning. The application
> program reads my web server's log file (currently about 35MB) and
> reduces it to a bunch of lists, then outputs the log contents arranged
> by each requestor's chronological list of hits. It's not really a
> strenuous test, but there's plenty of opportunity to screw up multiple
> levels of indirection, etc.
>
> The program was originally written on a Linux system and compiled/linked
> using the gcc toolchain.
>
> With the "pedantic" option it warned (8 times) about "Assignment within
> a conditional expression" but was otherwise friendly. The executable was
> some larger than I recollected the gcc version had been, but shrank by
> 8KB when I used the -O (peephole optimizer) option. I think that puts
> the size in the same ballpark with the gcc-compiled (with -O3) version.
>
> The only other C compiler I have for my current environment is TurboC
> V3.0 - an old friend, but not always convenient in current MS platforms. ...
|
| Show full article (1.68Kb) |
| no comments |
|
  |
Author: Tomás Ó hÉilidheTomás Ó hÉilidhe Date: May 6, 2008 11:47
On May 6, 7:19Â pm, Keith Thompson mib.org> wrote:
> Such a warning seems perfectly friendly to me. Â Would you prefer that
> it didn't tell you that you might have mistyped "==" as "="?
I love what gcc has to say about it:
warning: suggest parentheses around assignment used as truth value
I've actually taken its advice and started doing:
if ((i=5)) DoWhatever();
|
| |
| no comments |
|
  |
Author: Morris DoveyMorris Dovey Date: May 6, 2008 11:49
Keith Thompson wrote:
> Morris Dovey iedu.com> writes:
>> About a week ago, I downloaded Jacob's lcc package to my new (to me)
>> Win/XP box and gave it a test drive this morning.
> [...]
>
> jacob's compiler is called "lcc-win". "lcc" is a different compiler
> (the one on which lcc-win was based). It's an important distinction.
Hmm - ok. It does identify itself as lcc-win32, but the executable is
lcc.exe - I'll keep the distinction in mind. Thanks.
>> With the "pedantic" option it warned (8 times) about "Assignment
>> within a conditional expression" but was otherwise friendly.
>
> Such a warning seems perfectly friendly to me. Would you prefer that
> it didn't tell you that you might have mistyped "==" as "="?
Yes, unless I've actually made a mistake
|
| Show full article (0.87Kb) |
| no comments |
|
  |
|
|
  |
Author: Johannes BauerJohannes Bauer Date: May 6, 2008 11:51
Tomás Ó hÉilidhe schrieb:
> gcc hello.c -D NDEBUG -ansi -pedantic -S -O3 -o hello.exe
Ehrm, the "-S" parameter creates assembly output - are you sure that the
compiled executable works?
Kind Regards,
Johannes
--
"Wer etwas kritisiert muss es noch lange nicht selber besser können. Es
reicht zu wissen, daß andere es besser können und andere es auch
besser machen um einen Vergleich zu bringen." - Wolfgang Gerber
in de.sci.electronics <47fa8447$0$11545$9b622d9e@news.freenet.de>
|
| |
| no comments |
|
|
|
|
|
|