title: passing more parameters than specified in prototype in C
body: <p>I'm practicing reading others' code, picked up one of the simplest package in the GNU core-utils, GNU yes.  coreutils-8.26 to be specific, because my machine is debian stretch.  Code direct links are at the end.</p>
  
  <p>In main(), we have this line:</p>
  
  <pre><code>  parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
                    usage, AUTHORS, (char const *) NULL);
  </code></pre>
  
  <p><code>PROGRAM_NAME</code>, <code>PACKAGE_NAME</code>, <code>Version</code>, <code>AUTHORS</code> shall just be some <code>#define</code> macro for constant c-string, thus we indeed passed 8 parameters to <code>parse_long_options</code> here.</p>
  
  <p>In <code>long-options.h</code> which we included, we declared <code>parse_long_options</code> as following, which accepts only 6 arguments:</p>
  
  <pre><code>void parse_long_options (int _argc,
                       char **_argv,
                       const char *_command_name,
                       const char *_package,
                       const char *_version,
                       void (*_usage) (int),
                       /* const char *author1, ...*/ ...);
  </code></pre>
  
  <p>So, my question is, how does this package, GNU yes, actually compile and run?  It's an UB, at least in C99. (<a href="https://stackoverflow.com/a/17104818/9933842">1</a>)  Is it just because how GCC is implemented, and hence shall be avoided?</p>
  
  <p>code direct links:</p>
  
  <p>yes.c from coreutils-8.26: (<a href="https://ideone.com/iHXKS2" rel="nofollow noreferrer">2</a>)</p>
  
  <p>long-options.c from coreutils-8.26: (<a href="https://ideone.com/nns5Zt" rel="nofollow noreferrer">3</a>)</p>
  
  <p>long-options.h from coreutils-8.26: (<a href="https://ideone.com/YUwA1k" rel="nofollow noreferrer">4</a>)</p>
  
  <p>ftp of GNU: (<a href="https://ftp.gnu.org/gnu/coreutils/" rel="nofollow noreferrer">5</a>)</p>