[Commits] [wesnoth/wesnoth] 16a1a5: wesnothd/fuh: Fix instances of std::string initial...

GitHub noreply at github.com
Fri Jun 27 00:04:04 UTC 2014


  Branch: refs/heads/1.8
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 16a1a561bb2e2f464374165ef04ba25131d2ba60
      https://github.com/wesnoth/wesnoth/commit/16a1a561bb2e2f464374165ef04ba25131d2ba60
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2014-06-26 (Thu, 26 Jun 2014)

  Changed paths:
    M src/server/forum_user_handler.cpp

  Log Message:
  -----------
  wesnothd/fuh: Fix instances of std::string initialized from time_t(0)

Fixes the build with the fuh enabled on clang 3.3:

> src/server/forum_user_handler.cpp:206:10: error: expression which evaluates to zero treated as a null pointer constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]
>   return time_t(0);
>          ^~~~~~~~~
> src/server/forum_user_handler.cpp:215:10: error: expression which evaluates to zero treated as a null pointer constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]
>   return time_t(0);
>          ^~~~~~~~~

A time_t(0) is cast equivalently to a null pointer, and an empty C
string is equivalent to a null pointer for std::string instantiation.





More information about the Commits mailing list