Closed mcuee closed 2 years ago
In function 'tokenize',
inlined from 'terminal_mode' at D:/a/avrdude/avrdude/src/term.c:1259:12:
D:/a/avrdude/avrdude/src/term.c:1149:17: warning: pointer 'buf' may be used after 'realloc' [-Wuse-after-free]
1149 | ptrdiff_t k = buf - bufp;
| ^
D:/a/avrdude/avrdude/src/term.c:1133:18: note: call to 'realloc' here
1133 | buf_tmp = realloc(buf, bufsize);
| ^~~~~~~~~~~~~~~~~~~~~
I am not so sure if this one is valid or not. MSYS2 clang64 build is okay in my local machine. Usually clang can be a bit more strict than gcc but not in this case.
CLANG64 /c/work/avr/avrdude_test/avrdude_main
$ ./build.sh
-- Looking for libelf.h
-- Looking for libelf.h - found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Configuration summary:
-- ----------------------
-- DO HAVE libelf
-- DO HAVE libusb
-- DO HAVE libusb_1_0
-- DO HAVE libhidapi
-- DON'T HAVE libftdi
-- DO HAVE libftdi1
-- DISABLED doc
-- DISABLED parport
-- DISABLED linuxgpio
-- DISABLED linuxspi
-- ----------------------
-- Configuring done
CMake Warning (dev) at src/CMakeLists.txt:135 (add_library):
Policy CMP0115 is not set: Source file extensions must be explicit. Run
"cmake --help-policy CMP0115" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
File:
C:/work/avr/avrdude_test/avrdude_main/src/ac_cfg.h.in
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: C:/work/avr/avrdude_test/avrdude_main/build_mingw64_nt-10.0-22000
[1/57] Building C object src/CMakeFiles/libavrdude.dir/arduino.c.obj
[2/57] Building C object src/CMakeFiles/libavrdude.dir/avr910.c.obj
[3/57] Building C object src/CMakeFiles/libavrdude.dir/avrpart.c.obj
[4/57] Building C object src/CMakeFiles/libavrdude.dir/avr.c.obj
[5/57] Building C object src/CMakeFiles/libavrdude.dir/butterfly.c.obj
[6/57] Building C object src/CMakeFiles/libavrdude.dir/avrcache.c.obj
[7/57] Building C object src/CMakeFiles/libavrdude.dir/buspirate.c.obj
[8/57] Building C object src/CMakeFiles/libavrdude.dir/config.c.obj
[9/57] Building C object src/CMakeFiles/libavrdude.dir/dfu.c.obj
[10/57] Building C object src/CMakeFiles/libavrdude.dir/flip1.c.obj
[11/57] Building C object src/CMakeFiles/libavrdude.dir/flip2.c.obj
[12/57] Building C object src/CMakeFiles/libavrdude.dir/bitbang.c.obj
[13/57] Building C object src/CMakeFiles/libavrdude.dir/confwin.c.obj
[14/57] Building C object src/CMakeFiles/libavrdude.dir/jtagmkI.c.obj
[15/57] Building C object src/CMakeFiles/libavrdude.dir/avrftdi_tpi.c.obj
[16/57] Building C object src/CMakeFiles/libavrdude.dir/linuxgpio.c.obj
[17/57] Building C object src/CMakeFiles/libavrdude.dir/fileio.c.obj
[18/57] Building C object src/CMakeFiles/libavrdude.dir/linuxspi.c.obj
[19/57] Building C object src/CMakeFiles/libavrdude.dir/par.c.obj
[20/57] Building C object src/CMakeFiles/libavrdude.dir/lists.c.obj
[21/57] Building C object src/CMakeFiles/libavrdude.dir/pgm.c.obj
[22/57] Building C object src/CMakeFiles/libavrdude.dir/pgm_type.c.obj
[23/57] Building C object src/CMakeFiles/libavrdude.dir/avrftdi.c.obj
[24/57] Building C object src/CMakeFiles/libavrdude.dir/ppiwin.c.obj
[25/57] Building C object src/CMakeFiles/libavrdude.dir/micronucleus.c.obj
[26/57] Building C object src/CMakeFiles/libavrdude.dir/ser_avrdoper.c.obj
[27/57] Building C object src/CMakeFiles/libavrdude.dir/pindefs.c.obj
[28/57] Building C object src/CMakeFiles/libavrdude.dir/jtag3.c.obj
[29/57] Building C object src/CMakeFiles/libavrdude.dir/serialupdi.c.obj
[30/57] Building C object src/CMakeFiles/libavrdude.dir/stk500generic.c.obj
[31/57] Building C object src/CMakeFiles/libavrdude.dir/jtagmkII.c.obj
[32/57] Building C object src/CMakeFiles/libavrdude.dir/pickit2.c.obj
[33/57] Building C object src/CMakeFiles/libavrdude.dir/updi_readwrite.c.obj
[34/57] Building C object src/CMakeFiles/libavrdude.dir/teensy.c.obj
[35/57] Building C object src/CMakeFiles/libavrdude.dir/ft245r.c.obj
[36/57] Building C object src/CMakeFiles/libavrdude.dir/stk500.c.obj
[37/57] Building C object src/CMakeFiles/libavrdude.dir/serbb_win32.c.obj
[38/57] Building C object src/CMakeFiles/libavrdude.dir/updi_state.c.obj
[39/57] Building C object src/CMakeFiles/libavrdude.dir/updi_link.c.obj
[40/57] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm.c.obj
[41/57] Building C object src/CMakeFiles/libavrdude.dir/ser_win32.c.obj
[42/57] Building C object src/CMakeFiles/libavrdude.dir/usb_hidapi.c.obj
[43/57] Building C object src/CMakeFiles/libavrdude.dir/wiring.c.obj
[44/57] Building C object src/CMakeFiles/libavrdude.dir/usb_libusb.c.obj
[45/57] Building C object src/CMakeFiles/libavrdude.dir/update.c.obj
[46/57] Building C object src/CMakeFiles/libavrdude.dir/usbtiny.c.obj
[47/57] Building C object src/CMakeFiles/avrdude.dir/avrintel.c.obj
[48/57] Building C object src/CMakeFiles/libavrdude.dir/xbee.c.obj
[49/57] Building C object src/CMakeFiles/libavrdude.dir/__/lexer.c.obj
[50/57] Building C object src/CMakeFiles/libavrdude.dir/__/config_gram.c.obj
[51/57] Building C object src/CMakeFiles/libavrdude.dir/stk500v2.c.obj
[52/57] Building C object src/CMakeFiles/avrdude.dir/main.c.obj
[53/57] Building C object src/CMakeFiles/avrdude.dir/term.c.obj
[54/57] Building C object src/CMakeFiles/libavrdude.dir/usbasp.c.obj
[55/57] Building C object src/CMakeFiles/avrdude.dir/developer_opts.c.obj
[56/57] Linking C static library src\libavrdude.a
[57/57] Linking C executable src\avrdude.exe
Build succeeded.
Run
sudo cmake --build build_mingw64_nt-10.0-22000 --target install
to install.
flip2. macOS git main
I noticed that and solved it en passant in one of the PRs - should no longer happen.
- MSYS2 mingw32/ming64 build.
In function 'tokenize', inlined from 'terminal_mode' at D:/a/avrdude/avrdude/src/term.c:1259:12: D:/a/avrdude/avrdude/src/term.c:1149:17: warning: pointer 'buf' may be used after 'realloc' [-Wuse-after-free] 1149 | ptrdiff_t k = buf - bufp; | ^ D:/a/avrdude/avrdude/src/term.c:1133:18: note: call to 'realloc' here 1133 | buf_tmp = realloc(buf, bufsize); | ^~~~~~~~~~~~~~~~~~~~~
This one is a false alarm warning that's kind of hard to get rid off (we discussed that before)
So, all things condidered this can be closed.
1) macOS git main https://github.com/avrdudes/avrdude/actions/runs/3266550590/jobs/5370443795