home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,665 of 243,242   
   Keith Thompson to ldo@nz.invalid   
   Re: srand(0)   
   31 Dec 25 15:14:27   
   
   From: Keith.S.Thompson+u@gmail.com   
      
   Lawrence D’Oliveiro  writes:   
   > On Wed, 31 Dec 2025 15:29:09 +0200, Michael S wrote:   
   >> On Wed, 31 Dec 2025 03:10:52 -0000 (UTC)   
   >> Lawrence D’Oliveiro  wrote:   
   >>> Clearly on Windows, there are no guarantees about argc contains, so   
   >>> you shouldn’t be relying on it.   
   >>   
   >> How did you come to this conclusion?   
   >   
   > The fact that the C spec says so.   
      
   You may well be correct, but I don't know how you reached that   
   conclusion.   
      
   Older Linux kernels make it possible to invoke a program with argc==0   
   and argv[0]==NULL.  Newer Linux kernels have a modified execve() that   
   guarantees argc==1 and argv[0]!=NULL.  NetBSD still permits argc==0.   
      
   So some Unix-like systems (try to) guarantee argc>0, and some do not.   
      
   It's entirely possible that Windows goes beyond the ISO C   
   requirements and explicitly or implicitly guarantees argc>0.   
   It's also entirely possible that it doesn't.  Do you have any   
   concrete information one way or the other   
      
   >                                   Is there any standard on Windows for   
   > how different C compilers are supposed to handle argc/argv?   
      
   That's a good question, and I don't know the answer.   
      
   --   
   Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com   
   void Void(void) { Void(); } /* The recursive call of the void */   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca