Skip to content

windows with msys : warnings when printf functions #270

@vtorri

Description

@vtorri

Here are the warnings :

check_error.c: In function 'emalloc':
check_error.c:64:29: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
   64 |         eprintf("malloc of %u bytes failed:", __FILE__, __LINE__ - 2, n);
      |                            ~^                                         ~
      |                             |                                         |
      |                             unsigned int                              size_t {aka long long unsigned int}
      |                            %llu
check_error.c: In function 'erealloc':
check_error.c:74:30: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
   74 |         eprintf("realloc of %u bytes failed:", __FILE__, __LINE__ - 2, n);
      |                             ~^                                         ~
      |                              |                                         |
      |                              unsigned int                              size_t {aka long long unsigned int}
      |                             %llu
check_pack.c: In function 'pack':
check_pack.c:139:33: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
  139 |         eprintf("Value of len (%d) too big, max allowed %u\n",
      |                                ~^
      |                                 |
      |                                 int
      |                                %lld
  140 |                 __FILE__, __LINE__ - 3, len, INT_MAX);
      |                                         ~~~
      |                                         |
      |                                         size_t {aka long long unsigned int}
check_pack.c: In function 'upack':
check_pack.c:162:35: warning: unknown conversion type character ')' in format [-Wformat=]
  162 |         eprintf("Value of diff (%t) too big, max allowed %u\n",
      |                                   ^
check_pack.c:162:59: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'ptrdiff_t' {aka 'long long int'} [-Wformat=]
  162 |         eprintf("Value of diff (%t) too big, max allowed %u\n",
      |                                                          ~^
      |                                                           |
      |                                                           unsigned int
      |                                                          %llu
  163 |                 __FILE__, __LINE__ - 3, diff, INT_MAX);
      |                                         ~~~~               
      |                                         |
      |                                         ptrdiff_t {aka long long int}
check_pack.c:162:17: warning: too many arguments for format [-Wformat-extra-args]
  162 |         eprintf("Value of diff (%t) too big, max allowed %u\n",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check_pack.c:165:35: warning: unknown conversion type character ')' in format [-Wformat=]
  165 |         eprintf("Value of diff (%t) too small, min allowed %u\n",
      |                                   ^
check_pack.c:165:61: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'ptrdiff_t' {aka 'long long int'} [-Wformat=]
  165 |         eprintf("Value of diff (%t) too small, min allowed %u\n",
      |                                                            ~^
      |                                                             |
      |                                                             unsigned int
      |                                                            %llu
  166 |                 __FILE__, __LINE__ - 6, diff, INT_MIN);
      |                                         ~~~~                 
      |                                         |
      |                                         ptrdiff_t {aka long long int}
check_pack.c:165:17: warning: too many arguments for format [-Wformat-extra-args]
  165 |         eprintf("Value of diff (%t) too small, min allowed %u\n",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       check_str.lo

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