Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ncar!unmvax!pprg.unm.edu!topgun.dspo.gov!lanl!beta!dxk From: dxk@beta.lanl.gov (David M Koon) Newsgroups: comp.unix.wizards Subject: Re: scrogged argc, argv (was: system 5 vrs. bsd4.3 question) Summary: system 5 vrs. bsd4.3 question: the unkillable question Message-ID: <31436@beta.lanl.gov> Date: 5 Sep 89 20:48:35 GMT References: <28398@beta.lanl.gov> <10940@smoke.BRL.MIL> Organization: Los Alamos National Laboratory Lines: 41 In article <10940@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn) writes: > In article <28398@beta.lanl.gov> dxk@beta.lanl.gov (David M Koon) writes: > -#include > -#include > -#include > -#include "cffs.h" > -main(argc,argv) > -int argc; > -char *argv[]; > -{ > -.... > -However, on the SGI machine argc is undefined and argv seems to contain > -the environmental variables. Does anyone have any ideas as to what is > -causing this and how I can fix it? > > The last time someone asked this, it turned out that the preceding > header ("cffs.h" in this case) contained an error that affected the > apparent return type associated with main(). Fix "cffs.h". I am not sure what caused my article to resurface. I did not resubmit it. However, one more time here is what was really the problem #include struct foo{ ... } /* missing semi colon */ /* a screen or two of comments */ main(argc, argv) int argc; char **argv; { The solution was to add the semi colon and a suggestion was to declare main as int ie. int main(argc,argv)..... Again, I have no idea what caused the article to show up again. Dave Koon Los Alamos Nation Laboratory