Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Neved4 opened this issue Dec 9, 2023 · 1 comment

Comments

@Neved4
Copy link

Neved4 commented Dec 9, 2023

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;
}
@Neved4 Neved4 changed the title Error when using strftime() strftime(): error: parameter name must not begin with upper case letter (Char) Dec 9, 2023
@Neved4 Neved4 changed the title strftime(): error: parameter name must not begin with upper case letter (Char) strftime() error: parameter name must not begin with upper case letter (Char) Dec 9, 2023
@felipensp
Copy link
Member

Related to #164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants