Fix some compiler warnings
This is a great tool and I use it often! I've recently upgraded to Red Hat Enterprise Linux release 9
(Plow) with GCC 11.3.1
.
I am trying to build EasyTag from @hexchain branch hexchain/easytag:fix-compiler-warnings which is still unmerged after 2 years: !6 (closed)
But I am now getting new compiler errors:
src/tags/libapetag/info_mac.c: In function ‘info_mac_read’:
src/tags/libapetag/info_mac.c:175:64: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
175 | stream_info->Version = stream_info->EncoderVersion = header->ver;
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
src/tags/libapetag/info_mac.c:176:35: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
176 | stream_info->Channels = header->channels;
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
src/tags/libapetag/info_mac.c:177:37: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
177 | stream_info->SampleFreq = header->sampleRate;
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
src/tags/libapetag/info_mac.c:178:32: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
178 | stream_info->Flags = header->formatFlags;
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
src/tags/libapetag/info_mac.c:179:80: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
179 | stream_info->SamplesPerFrame = monkey_samples_per_frame(header->ver, header->compLevel);
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
src/tags/libapetag/info_mac.c:183:36: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
183 | stream_info->PeakLevel = header->peakLevel;
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
src/tags/libapetag/info_mac.c:185:33: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
185 | stream_info->Frames = header->totalFrames;
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
src/tags/libapetag/info_mac.c:188:36: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
188 | + header->finalFrameBlocks;
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
src/tags/libapetag/info_mac.c:202:45: error: array subscript ‘struct macHeader[0]’ is partly outside array bounds of ‘guint8[16]’ {aka ‘unsigned char[16]’} [-Werror=array-bounds]
202 | + header->headerBytesWAV) > 0
| ^~
src/tags/libapetag/info_mac.c:103:12: note: while referencing ‘header_buffer’
103 | guint8 header_buffer[MAC_FORMAT_HEADER_LENGTH];
| ^~~~~~~~~~~~~
My ./configure
is clean:
Linker ..................: gcc
CDDB support ............: yes
MP3 file support ........: yes
ID3v2.3 tags support ....: yes (id3lib-3.8.3)
Ogg Vorbis file support .: yes
Ogg Speex file support ..: yes
Ogg Opus file support ...: yes
FLAC file support .......: yes
MP4 file support ........: yes
WavPack support .........: yes
NLS/gettext .............: yes
Nautilus actions ........: yes
Tests during make check .: yes
Install prefix ..........: /usr/local
Any help would be appreciated!