Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Printf
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===2000s: -Wformat safety=== The need to do something about the range of problems resulting from lack of type safety has prompted attempts to make the C++ compiler {{code|printf}}-aware. The {{kbd|-Wformat}} option of [[GNU Compiler Collection|GCC]] allows compile-time checks to {{code|printf}} calls, enabling the compiler to detect a subset of invalid calls (and issue either a warning or an error, stopping the compilation altogether, depending on other flags).<ref>{{cite manual| section-url= https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wformat | url= https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/ | section= 3.8 Options to Request or Suppress Warnings | title= GCC 14.2 Manual | author=Free Software Foundation | author-link=Free Software Foundation | publisher= self-published | year= 2024 | accessdate= 2025-02-12 }}</ref> Since the compiler is inspecting {{code|printf}} format specifiers, enabling this effectively extends the C++ syntax by making formatting a part of it.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)