pbarada commented on PR #3517: URL: https://github.com/apache/nuttx-apps/pull/3517#issuecomment-4623927135
> > @pbarada Could you check this error? Thanks :-) https://github.com/apache/nuttx-apps/actions/runs/26888626961/job/79428686703#step:10:943 > > ``` > > Configuration/Tool: esp32-devkitc/crypto > > hash.c: In function 'hash_main': > > Error: hash.c:1081:3: error: 'huge_block' may be used uninitialized [-Werror=maybe-uninitialized] > > 1081 | free(huge_block); > > | ^~~~~~~~~~~~~~~~ > > hash.c:913:18: note: 'huge_block' was declared here > > 913 | unsigned char *huge_block = NULL; > > | ^~~~~~~~~~ > > ``` > > I'd love to "fix" it, but how can huge_block be uninitialized? The compiler notes at line 913 that huge_block is forcibly initialized during declaration to NULL which makes any code path that gets to line 1081 have an initialized value for huge_block. May take a bit (need to install xtensa toolchain) and try some code rearrangements, but I believe that compiler warning is erroneously generated Fixed. 1. Verified warning using xtensa-esp-elf-gcc (crosstool-NG esp-15.2.0_20251204) 15.2.0, added -Wextra to tease out any other lurking warnings in hash.c 2. Moved declaration of huge_block to top of main() to suppress "may be used uninitialized" warning 3. Added -Wextra to building of hash.c to see if other unreported warnings; declared "i" as unsigned int to suppress "comparison of integer expressions of different signedness" warning. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
