Skip to content

Bugfix: compiler warnings#212

Open
fliiiix wants to merge 3 commits into
rafael2k:masterfrom
fliiiix:bufix/compiler-warnings
Open

Bugfix: compiler warnings#212
fliiiix wants to merge 3 commits into
rafael2k:masterfrom
fliiiix:bufix/compiler-warnings

Conversation

@fliiiix

@fliiiix fliiiix commented Jan 15, 2026

Copy link
Copy Markdown

Address the overloaded-virtual warnings. And fix a few small things here and there.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 virtual operator= overloads and silence -Woverloaded-virtual.
  • Harden display_message() to avoid unsafe string handling (ensure null-termination; use snprintf; handle nullptr).
  • 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.

Comment thread darkice/src/TcpSocket.h Outdated
Comment thread darkice/src/CastSink.h Outdated
Comment thread darkice/src/BufferedSink.h Outdated
Comment thread darkice/src/SerialUlaw.h Outdated
Comment thread darkice/src/ShoutCast.h Outdated
Comment thread darkice/src/CastSink.h Outdated
Comment thread darkice/src/FileSink.h Outdated
Comment thread darkice/src/OssDspSource.h Outdated
Comment thread darkice/src/LameLibEncoder.h Outdated
Comment thread darkice/src/LameLibEncoder.h Outdated
@fliiiix fliiiix force-pushed the bufix/compiler-warnings branch from f41c9d0 to 3a95105 Compare March 6, 2026 14:06
fliiiix added 3 commits March 6, 2026 15:12
```
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);
      |                        ^
```
@fliiiix fliiiix force-pushed the bufix/compiler-warnings branch from 3a95105 to 9fcd5f5 Compare March 6, 2026 14:12
@fliiiix

fliiiix commented Mar 6, 2026

Copy link
Copy Markdown
Author

moved all using Sink::operator= to protected to not change the visibility and fixed the typo

@fliiiix

fliiiix commented Mar 17, 2026

Copy link
Copy Markdown
Author

@rafael2k anything else missing here?

@fliiiix

fliiiix commented Apr 16, 2026

Copy link
Copy Markdown
Author

@rafael2k any chance to get this merged?

@fliiiix

fliiiix commented May 14, 2026

Copy link
Copy Markdown
Author

👀

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

Successfully merging this pull request may close these issues.

2 participants