Opened 9 years ago
Closed 5 years ago
#8860 closed Bugs (wontfix)
Logically dead code in default_locale.cpp
Reported by: | Owned by: | Artyom Beilis | |
---|---|---|---|
Milestone: | To Be Determined | Component: | locale |
Version: | Boost 1.54.0 | Severity: | Optimization |
Keywords: | Cc: |
Description
In file : http://svn.boost.org/svn/boost/trunk/libs/locale/src/util/default_locale.cpp
std::string get_system_locale(bool use_utf8) { char const *lang = 0; if(!lang || !*lang) lang = getenv("LC_CTYPE"); -----------Some Code ------------------
!*lang) (!lang) is always true, the condition (!*lang) will never be reached and hence dead-code. |
Modify the condition as below :
if(!lang) lang = getenv("LC_CTYPE");
Note:
See TracTickets
for help on using tickets.
It is for code look nice - compiler will optimize it out.