c2v
c2v copied to clipboard
`strftime()` error: parameter name must not begin with upper case letter (`Char`)
When trying to convert to V using ./c2v on Neved4/swc.c#L98
Lines
strftime(timestr, sizeof(timestr), s, localtime(&t));
Output
v wcs.v
wcs.v:16:14: error: parameter name must not begin with upper case letter (`Char`)
14 | fn localtime( &Time_t) &Tm
15 |
16 | fn strftime( Char *restrict, usize, Char *restrict, Tm *restrict) usize
| ~~~~
17 |
18 | fn time( &Time_t) Time_t
Internal vfmt error while formatting file: wcs.v.
Encountered a total of: 1 errors.
took 108 ms ; output .v file: wcs.v
Translated 1 files in 108 ms.
MWE
Can reproduce with the following:
#include <stdio.h>
#include <time.h>
int main() {
time_t ctime;
struct tm *ltime;
char ftime[100];
ctime = time(NULL), ltime = localtime(&ctime);
strftime(ftime, sizeof(ftime), "%Y-%m-%d %H:%M:%S", ltime);
printf("Current time: %s\n", ftime);
return 0;
}
Related to #164