From: nikki AT gameboutique DOT co (nikki) Newsgroups: comp.os.msdos.djgpp Subject: Re: weird gcc thing Date: 17 Feb 1997 21:34:58 GMT Organization: GameBoutique Ltd. Lines: 38 Message-ID: <5eaiu2$j08@flex.uunet.pipex.com> References: NNTP-Posting-Host: www.gameboutique.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > Did you actually gave 2 arguments to your program? argv[0] is the > program name, argv[1] is the first argument. yep :) this code compiled fine under unix and linux, i was porting it you see. i managed to find something that exhibits this behavior... void main(int argc,char *argv[]) { printf("%f but should be %s\n",atof(argv[1]),argv[1]); } save as test.c and compile gcc test.c -o test now do test 8 it gives : 1.00000 should be 8 under linux and sunos it gives the correct value 8 however. i eventually figured this one out, it can be solved by ensuring a #include presumably linux and sunos were doing this automatically or something. but it struck me as weird behavior nonetheless, after all it compiled fine (ok -Wall would say implicit declaration, but you can do that with printf in the example above and printf has the correct behavior?) regards, nik > > If the above doesn't give a clue, post the shortest program you can craft > that exhibits this bug and the command line you pass it. -- Graham Tootell nikki AT gameboutique DOT com