Bugfix: compiler warnings#212
Open
fliiiix wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses compiler warnings (notably -Woverloaded-virtual) by explicitly re-exposing hidden base-class assignment operators in several derived classes, and includes a small safety improvement in duplicate-message suppression plus minor documentation link updates.
Changes:
- Add
using Base::operator=declarations across multiple derived classes to unhide base virtualoperator=overloads and silence-Woverloaded-virtual. - Harden
display_message()to avoid unsafe string handling (ensure null-termination; usesnprintf; handlenullptr). - Update INSTALL documentation links to use current HTTPS download pages.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| darkice/src/aflibDebug.cc | Makes repeated-message aggregation safer (null check, bounded copy/format). |
| darkice/src/TcpSocket.h | Unhides Sink/Source assignment operators to address overloaded-virtual warnings. |
| darkice/src/ShoutCast.h | Unhides CastSink assignment operator (warning-suppression). |
| darkice/src/SerialUlaw.h | Unhides AudioSource assignment operator (warning-suppression). |
| darkice/src/OssDspSource.h | Unhides AudioSource assignment operator (warning-suppression). |
| darkice/src/MultiThreadedConnector.h | Unhides Connector assignment operator (warning-suppression). |
| darkice/src/LameLibEncoder.h | Unhides AudioEncoder assignment operator (warning-suppression). |
| darkice/src/IceCast2.h | Unhides CastSink assignment operator (warning-suppression). |
| darkice/src/IceCast.h | Unhides CastSink assignment operator (warning-suppression). |
| darkice/src/FileSink.h | Unhides Sink assignment operator (warning-suppression). |
| darkice/src/FileCast.h | Unhides CastSink assignment operator (warning-suppression). |
| darkice/src/CastSink.h | Unhides Sink assignment operator (warning-suppression). |
| darkice/src/BufferedSink.h | Unhides Sink assignment operator (warning-suppression). |
| darkice/src/AudioSource.h | Unhides Source assignment operator (warning-suppression). |
| darkice/src/AudioEncoder.h | Unhides Sink assignment operator (warning-suppression). |
| darkice/INSTALL.vorbis | Updates Vorbis download URL. |
| darkice/INSTALL.lame | Updates LAME / SourceForge URLs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f41c9d0 to
3a95105
Compare
```
aflibDebug.cc: In function ‘void _Z15display_messageN10aflibDebug5LevelEPKc.part.0(aflibDebug::Level, const char*)’:
aflibDebug.cc:124:42: warning: ‘
(The previous message was r...’ directive writing 36 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
124 | sprintf(buff, "%s\n(The previous message was repeated %d times.)", lastMsg, msgCount);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aflibDebug.cc:124:39: note: directive argument in the range [1, 2147483647]
124 | sprintf(buff, "%s\n(The previous message was repeated %d times.)", lastMsg, msgCount);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:980,
from aflibDebug.cc:26:
In function ‘int sprintf(char*, const char*, ...)’,
inlined from ‘void _Z15display_messageN10aflibDebug5LevelEPKc.part.0(aflibDebug::Level, const char*)’ at aflibDebug.cc:124:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:34: note: ‘__builtin___sprintf_chk’ output between 46 and 1078 bytes into a destination of size 1024
30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
aflibDebug.cc: In function ‘void _Z15display_messageN10aflibDebug5LevelEPKc.part.0(aflibDebug::Level, const char*)’:
aflibDebug.cc:128:24: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 1024 equals destination size [-Wstringop-truncation]
128 | strncpy(lastMsg, msg, 1024);
| ^
```
3a95105 to
9fcd5f5
Compare
Author
|
moved all |
Author
|
@rafael2k anything else missing here? |
Author
|
@rafael2k any chance to get this merged? |
Author
|
👀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address the overloaded-virtual warnings. And fix a few small things here and there.