lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

prg2lout -h => coredump


From: Oliver Bandel
Subject: prg2lout -h => coredump
Date: Tue, 11 Sep 2001 00:05:36 +0200 (MET DST)

Hello,

the subject says it all: The prg2lout-program creates a coredump
on unknown cli-args, "-h" for example.


################################
address@hidden:/home/oliver/Download/Software/lout-3.24 > make prg2lout
gcc -ansi -pedantic -Wall -O3 -o prg2lout prg2lout.c
prg2lout.c: In function `Process':
prg2lout.c:3919: warning: `current_token' might be used uninitialized in this 
function
prg2lout.c:3920: warning: `end_delimiter_depth' might be used uninitialized in 
this function
prg2lout.c:3920: warning: `end_delimiter_count' might be used uninitialized in 
this function
prg2lout.c:3921: warning: `curr_end_delim' might be used uninitialized in this 
function
prg2lout.c:3921: warning: `curr_bracket_delim' might be used uninitialized in 
this function
prg2lout.c:3961: warning: `t' might be used uninitialized in this function
prg2lout.c:4023: warning: `pattern' might be used uninitialized in this function
prg2lout.c:4067: warning: `pattern' might be used uninitialized in this function
prg2lout.c: In function `main':
prg2lout.c:4637: warning: implicit declaration of function `sleep'
prg2lout.c:4350: warning: `i' might be used uninitialized in this function
chmod a+x prg2lout
address@hidden:/home/oliver/Download/Software/lout-3.24 > prg2lout -h
Segmentation fault (core dumped)
address@hidden:/home/oliver/Download/Software/lout-3.24 > 
################################




Ok, look at this nice stuff at the following lines:

################################
address@hidden:/home/oliver/Download/Software/lout-3.24 > gcc -ansi -pedantic 
-Wall -O3 -g -o prg2lout prg2lout-patched.c 
prg2lout-patch.c: In function `Process':
prg2lout-patch.c:3919: warning: `current_token' might be used uninitialized in 
this function
prg2lout-patch.c:3920: warning: `end_delimiter_depth' might be used 
uninitialized in this function
prg2lout-patch.c:3920: warning: `end_delimiter_count' might be used 
uninitialized in this function
prg2lout-patch.c:3921: warning: `curr_end_delim' might be used uninitialized in 
this function
prg2lout-patch.c:3921: warning: `curr_bracket_delim' might be used 
uninitialized in this function
prg2lout-patch.c:3961: warning: `t' might be used uninitialized in this function
prg2lout-patch.c:4023: warning: `pattern' might be used uninitialized in this 
function
prg2lout-patch.c:4067: warning: `pattern' might be used uninitialized in this 
function
address@hidden:/home/oliver/Download/Software/lout-3.24 > prg2lout  -h
prg2lout: unknown command line flag -h
address@hidden:/home/oliver/Download/Software/lout-3.24 > 
################################

Yes!

And there is no warning about the uninitialized "i" during
compilation, now. :-)

Yes, that's , why I like paranoid compilers... ;-)

And that's, why I like GPL-Software. :-)



Solution to the problem:

################################
address@hidden:/home/oliver/Download/Software/lout-3.24 > diff prg2lout.c 
prg2lout-patched.c 
4636c4636
<         argv[i]);
---
>         argv[arg_pos]);
address@hidden:/home/oliver/Download/Software/lout-3.24 > 
################################


Ciao,
   Oliver


reply via email to

[Prev in Thread] Current Thread [Next in Thread]