va_args going unused ok?

From: Michael B Allen (mba2000_at_ioplex.com)
Date: 03/30/05

  • Next message: Krishanu Debnath: "Re: setting initial values in struct template"
    Date: Wed, 30 Mar 2005 02:24:37 -0500
    
    

    Is it legit to not use arguments of a variable argument function? For
    example consider that printf here does not use arg if fi = 1.

      void
      foo(int fi, const char *arg)
      {
         const char *fmts = { "%s", "" };
         printf(fmts[fi], arg);
      }

    Thanks,
    Mike


  • Next message: Krishanu Debnath: "Re: setting initial values in struct template"

    Relevant Pages