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: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1