bugTiny C Compiler - Bugs: bug #47885, Error in parsing va_list

 
 

bug #47885: Error in parsing va_list

Submitted by:  None
Submitted on:  Tue 10 May 2016 09:37:00 AM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 18 May 2017 01:17:27 PM UTC, comment #1:

The provided code snippet works fine on my Arch Linux and Alpine Linux (musl libc) with TCC compiled from the mod branch (the one which is under active development).

P.S. I am not a TCC developer.

Vlad Frolov <frol>
Tue 10 May 2016 09:37:00 AM UTC, original submission:

#include <stdio.h>
#include <stdarg.h>

void err(const char* format, ...) {
va_list args;
va_start(args, format);
vprintf(format, args);
va_end(args);
}

int main(void) {
err("These numbers: %i, %i\n", 11, 22);
return 0;
}

Should produce: These numbers: 11, 22
Actually produces: These numbers: <random number>, 11

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by frol (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.4