]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
echo: pacify Oracle Studio 12.6
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Jun 2020 05:20:34 +0000 (22:20 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Jun 2020 05:39:48 +0000 (22:39 -0700)
* src/echo.c (main): Don’t assign pointer to bool.
This is well-defined in C99, but is arguably bad style
and Oracle Studio 12.6 complains.

src/echo.c

index b5a6e966c4fddf92b39ec5344a9a9fd5b08fe324..e7f3447ee2de77ef8d68161915a217e07a2bdac2 100644 (file)
@@ -108,7 +108,7 @@ int
 main (int argc, char **argv)
 {
   bool display_return = true;
-  bool posixly_correct = getenv ("POSIXLY_CORRECT");
+  bool posixly_correct = !!getenv ("POSIXLY_CORRECT");
   bool allow_options =
     (! posixly_correct
      || (! DEFAULT_ECHO_TO_XPG && 1 < argc && STREQ (argv[1], "-n")));