Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed gcc 12 #700

Open
Filin3 opened this issue Aug 24, 2022 · 0 comments
Open

Build failed gcc 12 #700

Filin3 opened this issue Aug 24, 2022 · 0 comments

Comments

@Filin3
Copy link

Filin3 commented Aug 24, 2022

software:
OS: Arch Linux
gcc 12.2.0
g++ 12.2.0

commands:
git clone https://github.com/matlo/GIMX.git
git submodule init
git submodule update
make

make output:

cc -fPIC -Iinclude -Wall -Wextra -Werror -O3 -I../ -DGLOG_NAME=gimxcontroller -c -o src/controller.o src/controller.c
src/controller.c: In function ‘controller_get_axis_index’:
src/controller.c:361:10: error: the comparison will always evaluate as ‘true’ for the address of ‘name’ will never be NULL [-Werror=address]
361 | if(controllers[C_TYPE_SIXAXIS]->axes[i].name)
| ^~~~~~~~~~~
In file included from src/controller.c:6:
src/../include/controller.h:46:14: note: ‘name’ declared here
46 | const char name[AXIS_NAME_MAX_SIZE];
| ^~~~

In function ‘get_string_descriptor’,
inlined from ‘get_string_descriptor’ at src/gusb.c:523:12:
src/gusb.c:569:120: error: pointer ‘data’ may be used after ‘realloc’ [-Werror=use-after-free]
569 | LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_STRING << 8) | index, descriptors->langId0.wData[0], data, descriptor->bLength, DEFAULT_TIMEOUT);
| ~~~~~~~~~~^~~~~~~~~
src/gusb.c:559:18: note: call to ‘realloc’ here
559 | void * ptr = realloc(data, descriptor->bLength * sizeof(*data));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

No branches or pull requests

1 participant