Skip to content

strftime() error: parameter name must not begin with upper case letter (Char) #163

@Neved4

Description

@Neved4

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions