public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* Is it possible not to use snprintf or any other stdio functionalities to throw std::logic_error in standard library containers?
@ 2021-05-15  2:25 unlvsur unlvsur
  2021-05-15  8:23 ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: unlvsur unlvsur @ 2021-05-15  2:25 UTC (permalink / raw)
  To: unlvsur unlvsur via Libstdc++

The issue is that this will silently introduce dependency to stdio. On MinGW-w64 for example, any snprintf function call will bloat binary size for 70kb, that is even we shared linking with both msvcrt and libstdc++.

I frequently see a random bloat because of that.

By the way, it also hurts optimizations since compilers cannot merge them together.

Better just throw an exception with “vector<T> out of bounds” instead of formatting subscriptor.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-20 20:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-15  2:25 Is it possible not to use snprintf or any other stdio functionalities to throw std::logic_error in standard library containers? unlvsur unlvsur
2021-05-15  8:23 ` Jonathan Wakely
2021-05-20 19:20   ` Jonathan Wakely
     [not found]     ` <DM6PR05MB4697628C7E6769B8FCDA1D6ED62A9@DM6PR05MB4697.namprd05.prod.outlook.com>
2021-05-20 19:35       ` Jonathan Wakely
2021-05-20 19:47         ` unlvsur unlvsur
2021-05-20 19:50           ` unlvsur unlvsur
2021-05-20 20:00             ` Jonathan Wakely
2021-05-20 19:52           ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).