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

static variables #379

Open
IngeniariusSoftware opened this issue Sep 10, 2022 · 0 comments
Open

static variables #379

IngeniariusSoftware opened this issue Sep 10, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@IngeniariusSoftware
Copy link
Member

remove the line if it fixed in the testcuite:
00197: TODO static variables

the test:
https://github.com/c-testsuite/c-testsuite/blob/master/tests/single-exec/00197.c

#include <stdio.h>

static int fred = 1234;
static int joe;

void henry()
{
   static int fred = 4567;

   printf("%d\n", fred);
   fred++;
}

int main()
{
   printf("%d\n", fred);
   henry();
   henry();
   henry();
   henry();
   printf("%d\n", fred);
   fred = 8901;
   joe = 2345;
   printf("%d\n", fred);
   printf("%d\n", joe);

   return 0;
}

/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
@IngeniariusSoftware IngeniariusSoftware added the bug Something isn't working label Sep 10, 2022
@nkchuykin nkchuykin self-assigned this Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants