<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:asl@math.spbu.ru" title="Anton Korobeynikov <asl@math.spbu.ru>"> <span class="fn">Anton Korobeynikov</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Interpreter allocates argv on heap"
   href="http://llvm.org/bugs/show_bug.cgi?id=15503">bug 15503</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>asl@math.spbu.ru
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Interpreter allocates argv on heap"
   href="http://llvm.org/bugs/show_bug.cgi?id=15503#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Interpreter allocates argv on heap"
   href="http://llvm.org/bugs/show_bug.cgi?id=15503">bug 15503</a>
              from <span class="vcard"><a class="email" href="mailto:asl@math.spbu.ru" title="Anton Korobeynikov <asl@math.spbu.ru>"> <span class="fn">Anton Korobeynikov</span></a>
</span></b>
        <pre>According to C99 5.1.2.2.1:

2.
If they [argc, argv] are declared, the parameters to the main function shall
obey the following constraints:
— The value of argc shall be nonnegative.

— argv[argc] shall be a null pointer.

— If the value of argc is greater than zero, the array members argv[0] through
argv[argc-1] inclusive shall contain pointers to strings, which are given
implementation-defined values by the host environment prior to program startup.
The intent is to supply to the program information determined prior to program
startup from elsewhere in the hosted environment. If the host environment is
not capable of supplying strings with letters in both uppercase and lowercase,
the implementation
shall ensure that the strings are received in lowercase.

— If the value of argc is greater than zero, the string pointed to by argv[0]
represents the program name; argv[0][0] shall be the null character if the
program name is not available from the host environment. If the value of argc
is
greater than one, the strings pointed to by argv[1] through argv[argc-1]
represent the program parameters.

— The parameters argc and argv and the strings pointed to by the argv array
shall
be modifiable by the program, and retain their last-stored values between
program
startup and program termination.

So, the location of the arguments are implementation defined and it's pretty
fine to pass them on heap.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>