8000 Compile error on both Windows and Arch · Issue #44 · anestisb/android-simg2img · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Compile error on both Windows and Arch #44
Open
@smaybius

Description

@smaybius
PS C:\Users\temporary\android-simg2img> mingw32-make
mingw32-make: Circular backed_block.cpp <- backed_block.cpp dependency dropped.
g++ -std=gnu++17 -O2 -W -Wall -Werror -Wextra -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -Iinclude -Iandroid-base/include -c backed_block.cpp -o backed_block.o
backed_block.cpp: In function 'backed_block_list* backed_block_list_new(unsigned int)':
backed_block.cpp:114:51: error: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  114 |       reinterpret_cast<backed_block_list*>(calloc(sizeof(struct backed_block_list), 1));
      |                                                   ^~~~~
5B78
~~~~~~~~~~~~~~~~~~~~~~~~~~~
backed_block.cpp:114:51: note: earlier argument should specify number of elements, later size of each element
cc1plus.exe: all warnings being treated as errors
mingw32-make: *** [Makefile:97: backed_block.o] Error 1

Make is installed as ucrt64-make, and g++ version is gcc version 14.2.0 (Rev2, Built by MSYS2 project).

For my Arch dual-boot:

[smaybius@smaybs-endevor android-simg2img]$ make
g++ -std=gnu++17 -O2 -W -Wall -Werror -Wextra -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -Iinclude -Iandroid-base/include -c backed_block.cpp -o backed_block.o
backed_block.cpp: In function ‘backed_block_list* backed_block_list_new(unsigned int)’:
backed_block.cpp:114:51: error: ‘void* calloc(size_t, size_t)’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  114 |       reinterpret_cast<backed_block_list*>(calloc(sizeof(struct backed_block_list), 1));
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backed_block.cpp:114:51: note: earlier argument should specify number of elements, later size of each element
cc1plus: all warnings being treated as errors
make: *** [Makefile:97: backed_block.o] Error 1
[smaybius@smaybs-endevor android-simg2img]$

gcc version 14.2.1 20240910 (GCC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0