Skip to content

Conversation

@planet36
Copy link

@planet36 planet36 commented Sep 7, 2022

Use macro constant PRIx64 instead of llx to fix the following warning.

pcg32x2-demo.c: In function 'main':
pcg32x2-demo.c:156:30: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'uint64_t' {aka 'long unsigned int'} [-Wformat=]
  156 |             printf(" 0x%016llx", pcg32x2_random_r(&rng));
      |                        ~~~~~~^   ~~~~~~~~~~~~~~~~~~~~~~
      |                              |   |
      |                              |   uint64_t {aka long unsigned int}
      |                              long long unsigned int
      |                        %016lx

Change "C89" to "C99" because fixed width integer types were added in C99.

Sort #include directives in pcg32x2-demo.c.

Add newline at end of .gitignore.

Use macro constant PRIx64 instead of "llx" to fix the following warning.
```
pcg32x2-demo.c: In function 'main':
pcg32x2-demo.c:156:30: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'uint64_t' {aka 'long unsigned int'} [-Wformat=]
  156 |             printf(" 0x%016llx", pcg32x2_random_r(&rng));
      |                        ~~~~~~^   ~~~~~~~~~~~~~~~~~~~~~~
      |                              |   |
      |                              |   uint64_t {aka long unsigned int}
      |                              long long unsigned int
      |                        %016lx
```
Fixed width integer types were added in C99.
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

Successfully merging this pull request may close these issues.

1 participant