head 1.1; branch 1.1.1; access; symbols netbsd-11-0-RC4:1.1.1.6 netbsd-11-0-RC3:1.1.1.6 netbsd-11-0-RC2:1.1.1.6 netbsd-11-0-RC1:1.1.1.6 gcc-14-3-0:1.1.1.6 perseant-exfatfs-base-20250801:1.1.1.6 netbsd-11:1.1.1.6.0.4 netbsd-11-base:1.1.1.6 gcc-12-5-0:1.1.1.6 netbsd-10-1-RELEASE:1.1.1.5 perseant-exfatfs-base-20240630:1.1.1.6 gcc-12-4-0:1.1.1.6 perseant-exfatfs:1.1.1.6.0.2 perseant-exfatfs-base:1.1.1.6 netbsd-8-3-RELEASE:1.1.1.3 netbsd-9-4-RELEASE:1.1.1.3 netbsd-10-0-RELEASE:1.1.1.5 netbsd-10-0-RC6:1.1.1.5 netbsd-10-0-RC5:1.1.1.5 netbsd-10-0-RC4:1.1.1.5 netbsd-10-0-RC3:1.1.1.5 netbsd-10-0-RC2:1.1.1.5 netbsd-10-0-RC1:1.1.1.5 gcc-12-3-0:1.1.1.6 gcc-10-5-0:1.1.1.5 netbsd-10:1.1.1.5.0.6 netbsd-10-base:1.1.1.5 netbsd-9-3-RELEASE:1.1.1.3 gcc-10-4-0:1.1.1.5 cjep_sun2x-base1:1.1.1.5 cjep_sun2x:1.1.1.5.0.4 cjep_sun2x-base:1.1.1.5 cjep_staticlib_x-base1:1.1.1.5 netbsd-9-2-RELEASE:1.1.1.3 cjep_staticlib_x:1.1.1.5.0.2 cjep_staticlib_x-base:1.1.1.5 gcc-10-3-0:1.1.1.5 netbsd-9-1-RELEASE:1.1.1.3 gcc-9-3-0:1.1.1.4 gcc-7-5-0:1.1.1.3 phil-wifi-20200421:1.1.1.3 phil-wifi-20200411:1.1.1.3 is-mlppp:1.1.1.3.0.20 is-mlppp-base:1.1.1.3 phil-wifi-20200406:1.1.1.3 netbsd-8-2-RELEASE:1.1.1.3 gcc-8-4-0:1.1.1.3 netbsd-9-0-RELEASE:1.1.1.3 netbsd-9-0-RC2:1.1.1.3 netbsd-9-0-RC1:1.1.1.3 phil-wifi-20191119:1.1.1.3 gcc-8-3-0:1.1.1.3 netbsd-9:1.1.1.3.0.18 netbsd-9-base:1.1.1.3 phil-wifi-20190609:1.1.1.3 netbsd-8-1-RELEASE:1.1.1.3 netbsd-8-1-RC1:1.1.1.3 pgoyette-compat-merge-20190127:1.1.1.3 pgoyette-compat-20190127:1.1.1.3 gcc-7-4-0:1.1.1.3 pgoyette-compat-20190118:1.1.1.3 pgoyette-compat-1226:1.1.1.3 pgoyette-compat-1126:1.1.1.3 gcc-6-5-0:1.1.1.3 pgoyette-compat-1020:1.1.1.3 pgoyette-compat-0930:1.1.1.3 pgoyette-compat-0906:1.1.1.3 netbsd-7-2-RELEASE:1.1.1.2 pgoyette-compat-0728:1.1.1.3 netbsd-8-0-RELEASE:1.1.1.3 phil-wifi:1.1.1.3.0.16 phil-wifi-base:1.1.1.3 pgoyette-compat-0625:1.1.1.3 netbsd-8-0-RC2:1.1.1.3 pgoyette-compat-0521:1.1.1.3 pgoyette-compat-0502:1.1.1.3 pgoyette-compat-0422:1.1.1.3 netbsd-8-0-RC1:1.1.1.3 pgoyette-compat-0415:1.1.1.3 pgoyette-compat-0407:1.1.1.3 pgoyette-compat-0330:1.1.1.3 pgoyette-compat-0322:1.1.1.3 pgoyette-compat-0315:1.1.1.3 netbsd-7-1-2-RELEASE:1.1.1.2 pgoyette-compat:1.1.1.3.0.14 pgoyette-compat-base:1.1.1.3 gcc-6-4-0:1.1.1.3 netbsd-7-1-1-RELEASE:1.1.1.2 gcc-5-5-0:1.1.1.3 matt-nb8-mediatek:1.1.1.3.0.12 matt-nb8-mediatek-base:1.1.1.3 perseant-stdc-iso10646:1.1.1.3.0.10 perseant-stdc-iso10646-base:1.1.1.3 netbsd-8:1.1.1.3.0.8 netbsd-8-base:1.1.1.3 prg-localcount2-base3:1.1.1.3 prg-localcount2-base2:1.1.1.3 prg-localcount2-base1:1.1.1.3 prg-localcount2:1.1.1.3.0.6 prg-localcount2-base:1.1.1.3 pgoyette-localcount-20170426:1.1.1.3 bouyer-socketcan-base1:1.1.1.3 pgoyette-localcount-20170320:1.1.1.3 netbsd-7-1:1.1.1.2.0.10 netbsd-7-1-RELEASE:1.1.1.2 netbsd-7-1-RC2:1.1.1.2 netbsd-7-nhusb-base-20170116:1.1.1.2 bouyer-socketcan:1.1.1.3.0.4 bouyer-socketcan-base:1.1.1.3 pgoyette-localcount-20170107:1.1.1.3 netbsd-7-1-RC1:1.1.1.2 pgoyette-localcount-20161104:1.1.1.3 netbsd-7-0-2-RELEASE:1.1.1.2 localcount-20160914:1.1.1.3 netbsd-7-nhusb:1.1.1.2.0.8 netbsd-7-nhusb-base:1.1.1.2 pgoyette-localcount-20160806:1.1.1.3 pgoyette-localcount-20160726:1.1.1.3 pgoyette-localcount:1.1.1.3.0.2 pgoyette-localcount-base:1.1.1.3 gcc-5-4-0:1.1.1.3 netbsd-7-0-1-RELEASE:1.1.1.2 gcc-5-3-0:1.1.1.3 netbsd-7-0:1.1.1.2.0.6 netbsd-7-0-RELEASE:1.1.1.2 gcc-4-8-5-pre-gcc-old-import:1.1.1.2 netbsd-7-0-RC3:1.1.1.2 netbsd-7-0-RC2:1.1.1.2 post-gcc-4-8-5-merge:1.1.1.2 gcc-4-8-5:1.1.1.2 netbsd-7-0-RC1:1.1.1.2 gcc-4-8-4:1.1.1.2 gcc-4-8-20141009:1.1.1.2 netbsd-6-0-6-RELEASE:1.1.1.1 netbsd-6-1-5-RELEASE:1.1.1.1 netbsd-7:1.1.1.2.0.4 netbsd-7-base:1.1.1.2 gcc-4-8-3:1.1.1.2 yamt-pagecache-base9:1.1.1.2 yamt-pagecache-tag8:1.1.1.1 netbsd-6-1-4-RELEASE:1.1.1.1 netbsd-6-0-5-RELEASE:1.1.1.1 tls-earlyentropy:1.1.1.2.0.2 tls-earlyentropy-base:1.1.1.2 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.2 riastradh-drm2-base3:1.1.1.2 gcc-4-8-3-pre-r208254:1.1.1.2 gcc-4-8-3-pre-r206687:1.1.1.2 imported-to-gcc-old-20140227-0107:1.1.1.1 netbsd-6-1-3-RELEASE:1.1.1.1 netbsd-6-0-4-RELEASE:1.1.1.1 netbsd-6-1-2-RELEASE:1.1.1.1 netbsd-6-0-3-RELEASE:1.1.1.1 netbsd-6-1-1-RELEASE:1.1.1.1 riastradh-drm2-base2:1.1.1.1 riastradh-drm2-base1:1.1.1.1 riastradh-drm2:1.1.1.1.0.12 riastradh-drm2-base:1.1.1.1 netbsd-6-1:1.1.1.1.0.16 netbsd-6-0-2-RELEASE:1.1.1.1 netbsd-6-1-RELEASE:1.1.1.1 netbsd-6-1-RC4:1.1.1.1 netbsd-6-1-RC3:1.1.1.1 agc-symver:1.1.1.1.0.14 agc-symver-base:1.1.1.1 netbsd-6-1-RC2:1.1.1.1 netbsd-6-1-RC1:1.1.1.1 yamt-pagecache-base8:1.1.1.1 netbsd-6-0-1-RELEASE:1.1.1.1 yamt-pagecache-base7:1.1.1.1 matt-nb6-plus-nbase:1.1.1.1 yamt-pagecache-base6:1.1.1.1 netbsd-6-0:1.1.1.1.0.10 netbsd-6-0-RELEASE:1.1.1.1 gcc-4-5-4:1.1.1.1 netbsd-6-0-RC2:1.1.1.1 tls-maxphys:1.1.1.1.0.8 tls-maxphys-base:1.1.1.2 matt-nb6-plus:1.1.1.1.0.6 matt-nb6-plus-base:1.1.1.1 netbsd-6-0-RC1:1.1.1.1 yamt-pagecache-base5:1.1.1.1 yamt-pagecache-base4:1.1.1.1 netbsd-6:1.1.1.1.0.4 netbsd-6-base:1.1.1.1 yamt-pagecache-base3:1.1.1.1 yamt-pagecache-base2:1.1.1.1 yamt-pagecache:1.1.1.1.0.2 yamt-pagecache-base:1.1.1.1 gcc-4-5-3:1.1.1.1 FSF:1.1.1; locks; strict; comment @# @; 1.1 date 2011.06.21.01.24.28; author mrg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2011.06.21.01.24.28; author mrg; state Exp; branches 1.1.1.1.2.1 1.1.1.1.8.1; next 1.1.1.2; 1.1.1.2 date 2014.03.01.08.41.20; author mrg; state Exp; branches; next 1.1.1.3; commitid TtaB91QNTknAoYqx; 1.1.1.3 date 2016.01.24.06.05.47; author mrg; state Exp; branches; next 1.1.1.4; commitid uWWfbLp08zOK79Sy; 1.1.1.4 date 2020.09.05.07.52.15; author mrg; state Exp; branches; next 1.1.1.5; commitid ZRYA7IOuwfMjAPmC; 1.1.1.5 date 2021.04.10.22.10.07; author mrg; state Exp; branches; next 1.1.1.6; commitid eC4g0MRpqTvEkNOC; 1.1.1.6 date 2023.07.30.05.21.23; author mrg; state Exp; branches; next ; commitid tk6nV4mbc9nVEMyE; 1.1.1.1.2.1 date 2014.05.22.16.37.47; author yamt; state Exp; branches; next ; commitid DX8bafDLmqEbpyBx; 1.1.1.1.8.1 date 2014.08.19.23.54.49; author tls; state Exp; branches; next ; commitid jTnpym9Qu0o4R1Nx; desc @@ 1.1 log @Initial revision @ text @
ISO C++ messages messages The std::messages facet implements message retrieval functionality equivalent to Java's java.text.MessageFormat .using either GNU gettext or IEEE 1003.1-200 functions.
Requirements The std::messages facet is probably the most vaguely defined facet in the standard library. It's assumed that this facility was built into the standard library in order to convert string literals from one locale to the other. For instance, converting the "C" locale's const char* c = "please" to a German-localized "bitte" during program execution.
22.2.7.1 - Template class messages [lib.locale.messages]
This class has three public member functions, which directly correspond to three protected virtual member functions. The public member functions are: catalog open(const string&, const locale&) const string_type get(catalog, int, int, const string_type&) const void close(catalog) const While the virtual functions are: catalog do_open(const string&, const locale&) const
-1- Returns: A value that may be passed to get() to retrieve a message, from the message catalog identified by the string name according to an implementation-defined mapping. The result can be used until it is passed to close(). Returns a value less than 0 if no such catalog can be opened.
string_type do_get(catalog, int, int, const string_type&) const
-3- Requires: A catalog cat obtained from open() and not yet closed. -4- Returns: A message identified by arguments set, msgid, and dfault, according to an implementation-defined mapping. If no such message can be found, returns dfault.
void do_close(catalog) const
-5- Requires: A catalog cat obtained from open() and not yet closed. -6- Effects: Releases unspecified resources associated with cat. -7- Notes: The limit on such resources, if any, is implementation-defined.
Design A couple of notes on the standard. First, why is messages_base::catalog specified as a typedef to int? This makes sense for implementations that use catopen, but not for others. Fortunately, it's not heavily used and so only a minor irritant. Second, by making the member functions const, it is impossible to save state in them. Thus, storing away information used in the 'open' member function for use in 'get' is impossible. This is unfortunate. The 'open' member function in particular seems to be oddly designed. The signature seems quite peculiar. Why specify a const string& argument, for instance, instead of just const char*? Or, why specify a const locale& argument that is to be used in the 'get' member function? How, exactly, is this locale argument useful? What was the intent? It might make sense if a locale argument was associated with a given default message string in the 'open' member function, for instance. Quite murky and unclear, on reflection. Lastly, it seems odd that messages, which explicitly require code conversion, don't use the codecvt facet. Because the messages facet has only one template parameter, it is assumed that ctype, and not codecvt, is to be used to convert between character sets. It is implicitly assumed that the locale for the default message string in 'get' is in the "C" locale. Thus, all source code is assumed to be written in English, so translations are always from "en_US" to other, explicitly named locales.
Implementation
Models This is a relatively simple class, on the face of it. The standard specifies very little in concrete terms, so generic implementations that are conforming yet do very little are the norm. Adding functionality that would be useful to programmers and comparable to Java's java.text.MessageFormat takes a bit of work, and is highly dependent on the capabilities of the underlying operating system. Three different mechanisms have been provided, selectable via configure flags: generic This model does very little, and is what is used by default. gnu The gnu model is complete and fully tested. It's based on the GNU gettext package, which is part of glibc. It uses the functions textdomain, bindtextdomain, gettext to implement full functionality. Creating message catalogs is a relatively straight-forward process and is lightly documented below, and fully documented in gettext's distributed documentation. ieee_1003.1-200x This is a complete, though untested, implementation based on the IEEE standard. The functions catopen, catgets, catclose are used to retrieve locale-specific messages given the appropriate message catalogs that have been constructed for their use. Note, the script po2msg.sed that is part of the gettext distribution can convert gettext catalogs into catalogs that catopen can use. A new, standards-conformant non-virtual member function signature was added for 'open' so that a directory could be specified with a given message catalog. This simplifies calling conventions for the gnu model.
The GNU Model The messages facet, because it is retrieving and converting between characters sets, depends on the ctype and perhaps the codecvt facet in a given locale. In addition, underlying "C" library locale support is necessary for more than just the LC_MESSAGES mask: LC_CTYPE is also necessary. To avoid any unpleasantness, all bits of the "C" mask (i.e. LC_ALL) are set before retrieving messages. Making the message catalogs can be initially tricky, but become quite simple with practice. For complete info, see the gettext documentation. Here's an idea of what is required: Make a source file with the required string literals that need to be translated. See intl/string_literals.cc for an example. Make initial catalog (see "4 Making the PO Template File" from the gettext docs). xgettext --c++ --debug string_literals.cc -o libstdc++.pot Make language and country-specific locale catalogs. cp libstdc++.pot fr_FR.po cp libstdc++.pot de_DE.po Edit localized catalogs in emacs so that strings are translated. emacs fr_FR.po Make the binary mo files. msgfmt fr_FR.po -o fr_FR.mo msgfmt de_DE.po -o de_DE.mo Copy the binary files into the correct directory structure. cp fr_FR.mo (dir)/fr_FR/LC_MESSAGES/libstdc++.mo cp de_DE.mo (dir)/de_DE/LC_MESSAGES/libstdc++.mo Use the new message catalogs. locale loc_de("de_DE"); use_facet<messages<char> >(loc_de).open("libstdc++", locale(), dir);
Use A simple example using the GNU model of message conversion. #include <iostream> #include <locale> using namespace std; void test01() { typedef messages<char>::catalog catalog; const char* dir = "/mnt/egcs/build/i686-pc-linux-gnu/libstdc++/po/share/locale"; const locale loc_de("de_DE"); const messages<char>& mssg_de = use_facet<messages<char> >(loc_de); catalog cat_de = mssg_de.open("libstdc++", loc_de, dir); string s01 = mssg_de.get(cat_de, 0, 0, "please"); string s02 = mssg_de.get(cat_de, 0, 0, "thank you"); cout << "please in german:" << s01 << '\n'; cout << "thank you in german:" << s02 << '\n'; mssg_de.close(cat_de); }
Future Things that are sketchy, or remain unimplemented: _M_convert_from_char, _M_convert_to_char are in flux, depending on how the library ends up doing character set conversions. It might not be possible to do a real character set based conversion, due to the fact that the template parameter for messages is not enough to instantiate the codecvt facet (1 supplied, need at least 2 but would prefer 3). There are issues with gettext needing the global locale set to extract a message. This dependence on the global locale makes the current "gnu" model non MT-safe. Future versions of glibc, i.e. glibc 2.3.x will fix this, and the C++ library bits are already in place. Development versions of the GNU "C" library, glibc 2.3 will allow a more efficient, MT implementation of std::messages, and will allow the removal of the _M_name_messages data member. If this is done, it will change the library ABI. The C++ parts to support glibc 2.3 have already been coded, but are not in use: once this version of the "C" library is released, the marked parts of the messages implementation can be switched over to the new "C" library functionality. At some point in the near future, std::numpunct will probably use std::messages facilities to implement truename/falsename correctly. This is currently not done, but entries in libstdc++.pot have already been made for "true" and "false" string literals, so all that remains is the std::numpunct coding and the configure/make hassles to make the installed library search its own catalog. Currently the libstdc++.mo catalog is only searched for the testsuite cases involving messages members. The following member functions: catalog open(const basic_string<char>& __s, const locale& __loc) const catalog open(const basic_string<char>&, const locale&, const char*) const; Don't actually return a "value less than 0 if no such catalog can be opened" as required by the standard in the "gnu" model. As of this writing, it is unknown how to query to see if a specified message catalog exists using the gettext package.
Bibliography The GNU C Library McGrath Roland Drepper Ulrich 2007 FSF Chapters 6 Character Set Handling, and 7 Locales and Internationalization Correspondence Drepper Ulrich 2002 ISO/IEC 14882:1998 Programming languages - C++ 1998 ISO ISO/IEC 9899:1999 Programming languages - C 1999 ISO System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008) 2008 The Open Group/The Institute of Electrical and Electronics Engineers, Inc. The C++ Programming Language, Special Edition Stroustrup Bjarne 2000 Addison Wesley, Inc. Appendix D Addison Wesley Standard C++ IOStreams and Locales Advanced Programmer's Guide and Reference Langer Angelika Kreft Klaus 2000 Addison Wesley Longman, Inc. Addison Wesley Longman API Specifications, Java Platform java.util.Properties, java.text.MessageFormat, java.util.Locale, java.util.ResourceBundle GNU gettext tools, version 0.10.38, Native Language Support Library and Tools.
@ 1.1.1.1 log @initial import of GCC 4.5.3 sources. changes since 4.1 are way too numerous to review, please see http://gcc.gnu.org/gcc-4.5/changes.html (and the 4.2, 4.3 and 4.4 versions, too.) this includes the core, c++, objc and the non java/ada/fortran parts of the testsuite. @ text @@ 1.1.1.1.8.1 log @Rebase to HEAD as of a few days ago. @ text @d1 1 a1 2
d4 1 a4 1 messages d6 6 a11 2 ISO C++ messages d13 1 a13 2 d15 1 d23 2 a24 2
Requirements d111 2 a112 2
Design d121 2 a122 3 catopen and define nl_catd as int, but not for others. Fortunately, it's not heavily used and so only a minor irritant. This has been reported as a possible defect in the standard (LWG 2028). d160 2 a161 1
Implementation d163 2 a164 3
Models d231 2 a232 2
The GNU Model d324 2 a325 2
Use d354 2 a355 2
Future d441 2 a442 2 Bibliography d445 1 a445 1 d447 9 a455 3 McGrathRoland DrepperUlrich d465 1 a465 1 d467 5 a471 2 DrepperUlrich d474 1 a474 1 d479 1 a479 1 d481 1 a481 1 d489 1 a489 1 d491 1 a491 1 d500 8 a507 7 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.opengroup.org/austin/"> System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008) </link> d517 1 a517 1 d519 5 a523 2 StroustrupBjarne d537 1 a537 1 d539 1 a539 1 d543 8 a550 2 LangerAngelika KreftKlaus d563 7 a569 7 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.oracle.com/technetwork/java/api/index.html"> API Specifications, Java Platform </link> a574 1 d576 8 a583 8 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.gnu.org/software/gettext/"> GNU gettext tools, version 0.10.38, Native Language Support Library and Tools. </link> @ 1.1.1.1.2.1 log @sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") @ text @d1 1 a1 2
d4 1 a4 1 messages d6 6 a11 2 ISO C++ messages d13 1 a13 2 d15 1 d23 2 a24 2
Requirements d111 2 a112 2
Design d121 2 a122 3 catopen and define nl_catd as int, but not for others. Fortunately, it's not heavily used and so only a minor irritant. This has been reported as a possible defect in the standard (LWG 2028). d160 2 a161 1
Implementation d163 2 a164 3
Models d231 2 a232 2
The GNU Model d324 2 a325 2
Use d354 2 a355 2
Future d441 2 a442 2 Bibliography d445 1 a445 1 d447 9 a455 3 McGrathRoland DrepperUlrich d465 1 a465 1 d467 5 a471 2 DrepperUlrich d474 1 a474 1 d479 1 a479 1 d481 1 a481 1 d489 1 a489 1 d491 1 a491 1 d500 8 a507 7 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.opengroup.org/austin/"> System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008) </link> d517 1 a517 1 d519 5 a523 2 StroustrupBjarne d537 1 a537 1 d539 1 a539 1 d543 8 a550 2 LangerAngelika KreftKlaus d563 7 a569 7 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.oracle.com/technetwork/java/api/index.html"> API Specifications, Java Platform </link> a574 1 d576 8 a583 8 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.gnu.org/software/gettext/"> GNU gettext tools, version 0.10.38, Native Language Support Library and Tools. </link> @ 1.1.1.2 log @import GCC 4.8 branch at r206687. highlights from: http://gcc.gnu.org/gcc-4.6/changes.html GCC now has stricter checks for invalid command-line options New -Wunused-but-set-variable and -Wunused-but-set-parameter warnings Many platforms have been obsoleted Link-time optimization improvements A new switch -fstack-usage has been added A new function attribute leaf was introduced A new warning, enabled by -Wdouble-promotion Support for selectively enabling and disabling warnings via #pragma GCC diagnostic has been added There is now experimental support for some features from the upcoming C1X revision of the ISO C standard Improved experimental support for the upcoming C++0x ISO C++ standard G++ now issues clearer diagnostics in several cases Updates for ARM, x86, MIPS, PPC/PPC64, SPARC Darwin, FreeBSD, Solaris 2, MinGW and Cygwin now all support __float128 on 32-bit and 64-bit x86 targets. [*1] highlights from: http://gcc.gnu.org/gcc-4.7/changes.html The -fconserve-space flag has been deprecated Support for a new parameter --param case-values-threshold=n was added Interprocedural and Link-time optimization improvements A new built-in, __builtin_assume_aligned, has been added A new warning option -Wunused-local-typedefs was added A new experimental command-line option -ftrack-macro-expansion was added Support for atomic operations specifying the C++11/C11 memory model has been added There is support for some more features from the C11 revision of the ISO C standard Improved experimental support for the new ISO C++ standard, C++11 Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE* A new option (-grecord-gcc-switches) was added highlights from: http://gcc.gnu.org/gcc-4.8/changes.html GCC now uses C++ as its implementation language. This means that to build GCC from sources, you will need a C++ compiler that understands C++ 2003 DWARF4 is now the default when generating DWARF debug information A new general optimization level, -Og, has been introduced A new option -ftree-partial-pre was added The option -fconserve-space has been removed The command-line options -fipa-struct-reorg and -fipa-matrix-reorg have been removed Interprocedural and Link-time optimization improvements AddressSanitizer, a fast memory error detector, has been added [*2] A new -Wsizeof-pointer-memaccess warning has been added G++ now supports a -std=c++1y option for experimentation with features proposed for the next revision of the standard, expected around 2014 Improved experimental support for the new ISO C++ standard, C++11 A new port has been added to support AArch64 Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE* [*1] we should support this too! [*2] we should look into this. https://code.google.com/p/address-sanitizer/ @ text @d1 1 a1 2
d4 1 a4 1 messages d6 6 a11 2 ISO C++ messages d13 1 a13 2 d15 1 d23 2 a24 2
Requirements d111 2 a112 2
Design d121 2 a122 3 catopen and define nl_catd as int, but not for others. Fortunately, it's not heavily used and so only a minor irritant. This has been reported as a possible defect in the standard (LWG 2028). d160 2 a161 1
Implementation d163 2 a164 3
Models d231 2 a232 2
The GNU Model d324 2 a325 2
Use d354 2 a355 2
Future d441 2 a442 2 Bibliography d445 1 a445 1 d447 9 a455 3 McGrathRoland DrepperUlrich d465 1 a465 1 d467 5 a471 2 DrepperUlrich d474 1 a474 1 d479 1 a479 1 d481 1 a481 1 d489 1 a489 1 d491 1 a491 1 d500 8 a507 7 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.opengroup.org/austin/"> System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008) </link> d517 1 a517 1 d519 5 a523 2 StroustrupBjarne d537 1 a537 1 d539 1 a539 1 d543 8 a550 2 LangerAngelika KreftKlaus d563 7 a569 7 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.oracle.com/technetwork/java/api/index.html"> API Specifications, Java Platform </link> a574 1 d576 8 a583 8 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.gnu.org/software/gettext/"> GNU gettext tools, version 0.10.38, Native Language Support Library and Tools. </link> @ 1.1.1.3 log @import GCC 5.3.0. see these urls for details which are too large to include here: http://gcc.gnu.org/gcc-4.9/changes.html http://gcc.gnu.org/gcc-5/changes.html (note that GCC 5.x is a release stream like GCC 4.9.x, 4.8.x, etc.) the main issues we will have are: The default mode for C is now -std=gnu11 instead of -std=gnu89. ARM: The deprecated option -mwords-little-endian has been removed. The options -mapcs, -mapcs-frame, -mtpcs-frame and -mtpcs-leaf-frame which are only applicable to the old ABI have been deprecated. MIPS: The o32 ABI has been modified and extended. The o32 64-bit floating-point register support is now obsolete and has been removed. It has been replaced by three ABI extensions FPXX, FP64A, and FP64. The meaning of the -mfp64 command-line option has changed. It is now used to enable the FP64A and FP64 ABI extensions. @ text @d2 1 a2 1 xml:id="std.localization.facet.messages" xreflabel="Messages"> d15 2 a16 2 The std::messages facet implements message retrieval functionality equivalent to Java's java.text.MessageFormat using either GNU gettext d24 1 a24 1 The std::messages facet is probably the most vaguely defined facet in d64 1 a64 1 catalog do_open(const string& name, const locale& loc) const d69 2 a70 2 -1- Returns: A value that may be passed to get() to retrieve a message, from the message catalog identified by the string name d72 1 a72 1 until it is passed to close(). Returns a value less than 0 if no such d79 1 a79 1 string_type do_get(catalog cat, int set , int msgid, const string_type& dfault) const d84 2 a85 2 -3- Requires: A catalog cat obtained from open() and not yet closed. -4- Returns: A message identified by arguments set, msgid, and dfault, d87 1 a87 1 be found, returns dfault. d93 1 a93 1 void do_close(catalog cat) const d98 2 a99 2 -5- Requires: A catalog cat obtained from open() and not yet closed. -6- Effects: Releases unspecified resources associated with cat. d491 1 a491 1 xlink:href="http://pubs.opengroup.org/onlinepubs/9699919799/"> @ 1.1.1.4 log @initial import of GCC 9.3.0. changes include: - live patching support - shell completion help - generally better diagnostic output (less verbose/more useful) - diagnostics and optimisation choices can be emitted in json - asan memory usage reduction - many general, and specific to switch, inter-procedure, profile and link-time optimisations. from the release notes: "Overall compile time of Firefox 66 and LibreOffice 6.2.3 on an 8-core machine was reduced by about 5% compared to GCC 8.3" - OpenMP 5.0 support - better spell-guesser - partial experimental support for c2x and c++2a - c++17 is no longer experimental - arm AAPCS GCC 6-8 structure passing bug fixed, may cause incompatibility (restored compat with GCC 5 and earlier.) - openrisc support @ text @d544 1 a544 1 xlink:href="https://www.oracle.com/technetwork/java/api/index.html"> @ 1.1.1.5 log @initial import of GCC 10.3.0. main changes include: caveats: - ABI issue between c++14 and c++17 fixed - profile mode is removed from libstdc++ - -fno-common is now the default new features: - new flags -fallocation-dce, -fprofile-partial-training, -fprofile-reproducible, -fprofile-prefix-path, and -fanalyzer - many new compile and link time optimisations - enhanced drive optimisations - openacc 2.6 support - openmp 5.0 features - new warnings: -Wstring-compare and -Wzero-length-bounds - extended warnings: -Warray-bounds, -Wformat-overflow, -Wrestrict, -Wreturn-local-addr, -Wstringop-overflow, -Warith-conversion, -Wmismatched-tags, and -Wredundant-tags - some likely C2X features implemented - more C++20 implemented - many new arm & intel CPUs known hundreds of reported bugs are fixed. full list of changes can be found at: https://gcc.gnu.org/gcc-10/changes.html @ text @d491 1 a491 1 xlink:href="https://pubs.opengroup.org/onlinepubs/9699919799/"> @ 1.1.1.6 log @initial import of GCC 12.3.0. major changes in GCC 11 included: - The default mode for C++ is now -std=gnu++17 instead of -std=gnu++14. - When building GCC itself, the host compiler must now support C++11, rather than C++98. - Some short options of the gcov tool have been renamed: -i to -j and -j to -H. - ThreadSanitizer improvements. - Introduce Hardware-assisted AddressSanitizer support. - For targets that produce DWARF debugging information GCC now defaults to DWARF version 5. This can produce up to 25% more compact debug information compared to earlier versions. - Many optimisations. - The existing malloc attribute has been extended so that it can be used to identify allocator/deallocator API pairs. A pair of new -Wmismatched-dealloc and -Wmismatched-new-delete warnings are added. - Other new warnings: -Wsizeof-array-div, enabled by -Wall, warns about divisions of two sizeof operators when the first one is applied to an array and the divisor does not equal the size of the array element. -Wstringop-overread, enabled by default, warns about calls to string functions reading past the end of the arrays passed to them as arguments. -Wtsan, enabled by default, warns about unsupported features in ThreadSanitizer (currently std::atomic_thread_fence). - Enchanced warnings: -Wfree-nonheap-object detects many more instances of calls to deallocation functions with pointers not returned from a dynamic memory allocation function. -Wmaybe-uninitialized diagnoses passing pointers or references to uninitialized memory to functions taking const-qualified arguments. -Wuninitialized detects reads from uninitialized dynamically allocated memory. -Warray-parameter warns about functions with inconsistent array forms. -Wvla-parameter warns about functions with inconsistent VLA forms. - Several new features from the upcoming C2X revision of the ISO C standard are supported with -std=c2x and -std=gnu2x. - Several C++20 features have been implemented. - The C++ front end has experimental support for some of the upcoming C++23 draft. - Several new C++ warnings. - Enhanced Arm, AArch64, x86, and RISC-V CPU support. - The implementation of how program state is tracked within -fanalyzer has been completely rewritten with many enhancements. see https://gcc.gnu.org/gcc-11/changes.html for a full list. major changes in GCC 12 include: - An ABI incompatibility between C and C++ when passing or returning by value certain aggregates containing zero width bit-fields has been discovered on various targets. x86-64, ARM and AArch64 will always ignore them (so there is a C ABI incompatibility between GCC 11 and earlier with GCC 12 or later), PowerPC64 ELFv2 always take them into account (so there is a C++ ABI incompatibility, GCC 4.4 and earlier compatible with GCC 12 or later, incompatible with GCC 4.5 through GCC 11). RISC-V has changed the handling of these already starting with GCC 10. As the ABI requires, MIPS takes them into account handling function return values so there is a C++ ABI incompatibility with GCC 4.5 through 11. - STABS: Support for emitting the STABS debugging format is deprecated and will be removed in the next release. All ports now default to emit DWARF (version 2 or later) debugging info or are obsoleted. - Vectorization is enabled at -O2 which is now equivalent to the original -O2 -ftree-vectorize -fvect-cost-model=very-cheap. - GCC now supports the ShadowCallStack sanitizer. - Support for __builtin_shufflevector compatible with the clang language extension was added. - Support for attribute unavailable was added. - Support for __builtin_dynamic_object_size compatible with the clang language extension was added. - New warnings: -Wbidi-chars warns about potentially misleading UTF-8 bidirectional control characters. -Warray-compare warns about comparisons between two operands of array type. - Some new features from the upcoming C2X revision of the ISO C standard are supported with -std=c2x and -std=gnu2x. - Several C++23 features have been implemented. - Many C++ enhancements across warnings and -f options. see https://gcc.gnu.org/gcc-12/changes.html for a full list. @ text @d1 1 a1 1
@