Skip to content

Conflicting -Wformat warnings (%lu vs %llu) #1

@theshteves

Description

@theshteves

In lib/sch, we've double "fixed" a format specifier warning back & forth.

See commits b997791 vs 5c8492b

What warnings are you receiving & how would you like to resolve this ambiguity?

For example, I'm currently staring at more -Wformat warnings, but fixing them would only put more warnings in your environment:

In file included from sch/Subckt.h:16:
sch/Placer.cpp:269:31: warning: format specifies type 'unsigned long' but the argument has type 'value_type' (aka 'unsigned long long') [-Wformat]
  269 |                 printf("hilbert %lu/%lu\n", currSch->hilbert.back(), currSch->totalArea);
      |                                 ~~~         ^~~~~~~~~~~~~~~~~~~~~~~
      |                                 %llu
sch/Placer.cpp:269:56: warning: format specifies type 'unsigned long' but the argument has type 'cl_ulong' (aka 'unsigned long long') [-Wformat]
  269 |                 printf("hilbert %lu/%lu\n", currSch->hilbert.back(), currSch->totalArea);
      |                                     ~~~                              ^~~~~~~~~~~~~~~~~~
      |                                     %llu
sch/Placer.cpp:296:32: warning: format specifies type 'unsigned long' but the argument has type 'value_type' (aka 'unsigned long long') [-Wformat]
  296 |                         printf("hilbert %lu/%lu\n", currSch->hilbert.back(), currSch->totalArea);
      |                                         ~~~         ^~~~~~~~~~~~~~~~~~~~~~~
      |                                         %llu
sch/Placer.cpp:296:57: warning: format specifies type 'unsigned long' but the argument has type 'cl_ulong' (aka 'unsigned long long') [-Wformat]
  296 |                         printf("hilbert %lu/%lu\n", currSch->hilbert.back(), currSch->totalArea);
      |                                             ~~~                              ^~~~~~~~~~~~~~~~~~
      |                                             %llu
sch/Placer.cpp:323:69: warning: format specifies type 'unsigned long' but the argument has type 'cl_ulong' (aka 'unsigned long long') [-Wformat]
  323 |                         printf("next instance %s %lu\n", currCkt->inst[*i].name.c_str(), schem[currCkt->inst[*i].subckt].totalArea);
      |                                                  ~~~                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                  %llu

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions