Skip to content

-Wformat still warns on Windows #5790

Closed

Description

@jangorecki

confirmed on master branch

* checking whether package 'data.table' can be installed ... WARNING
Found the following significant warnings:
  assign.c:474:15: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'R_xlen_t' {aka 'long long int'} [-Wformat=]
  assign.c:812:21: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat=]
  fread.c:149:19: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD' {aka 'long unsigned int'} [-Wformat=]
  gsumm.c:619:32: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  gsumm.c:676:17: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  gsumm.c:1119:19: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:163:33: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat=]
  init.c:180:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:181:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:183:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:184:59: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat=]
  init.c:185:47: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat=]
  init.c:185:47: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:186:38: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:187:38: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:188:41: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:189:38: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:190:38: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:191:38: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
  init.c:192:38: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
See 'C:/GitLab-Runner/builds/Rdatatable/data.table/data.table.Rcheck/00install.out' for details.
* used C compiler: 'gcc.exe (GCC) 12.3.0'

https://gitlab.com/Rdatatable/data.table/-/jobs/5676873688/artifacts/file/bus/test-win-dev/data.table.Rcheck/00install.out
@MichaelChirico

anyone is on windows to figure that out?

Activity

  1. added this to the 1.14.10 milestone on Dec 4, 2023
  2. MichaelChirico commented on Dec 5, 2023

    @MichaelChirico
    Member

    Here is suggesting we should use %zu for sizeof():

    https://stackoverflow.com/a/27296086/3576984

  3. MichaelChirico commented on Dec 5, 2023

    @MichaelChirico
    Member

    #5791 fixes all warnings from sizeof(), that leaves:

    assign.c:474:15: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'R_xlen_t' {aka 'long long int'} [-Wformat=]
    fread.c:149:19: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD' {aka 'long unsigned int'} [-Wformat=]
    

    Addressing those separately.

  4. jangorecki commented on Dec 5, 2023

    @jangorecki
    MemberAuthor

    @MichaelChirico I won't look at both PRs till tomorrow. You can trigger GLCI pipeline by pushing a branch to gitlab.com repo directly (don't push master branch there), you should have write access there. Mirror gh to gl works only for master branch. Just remember to merge recent master to your branch so CI yaml is up to date. Pipeline for master branch starts nightly at 4:15 UTC. Look at win-dev of course. And feel fee to merge when you see it fixes.

  5. MichaelChirico commented on Dec 6, 2023

    @MichaelChirico
    Member

    Closed on master, cherry-picking to hotfix now.

  6. MichaelChirico commented on Dec 6, 2023

    @MichaelChirico
    Member

    Closed by #5794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions