Patchwork Fix build failure in libcpp (PR c/61212)

login
register
mail settings
Submitter Marek Polacek
Date May 21, 2014, 2:27 p.m.
Message ID <20140521142712.GD5135@redhat.com>
Download mbox | patch
Permalink /patch/351212/
State New
Headers show

Comments

Marek Polacek - May 21, 2014, 2:27 p.m.
As described in the PR, the build fails when HAVE_DOS_BASED_FILE_SYSTEM
is in effect:

../../libcpp/files.c:393:56: error: suggest parentheses around ‘&&’
within ‘||’
[-Werror=parentheses]
       if (CPP_OPTION (pfile, canonical_system_headers) &&
       file->dir->sysp

This (untested, but trivial) patch fixes that.  Ok for trunk?

2014-05-21  Marek Polacek  <polacek@redhat.com>

	PR c/61212
	* files.c (find_file_in_dir): Add parens around &&.


	Marek
Tom Tromey - May 21, 2014, 6:42 p.m.
>>>>> "Marek" == Marek Polacek <polacek@redhat.com> writes:

Marek> 2014-05-21  Marek Polacek  <polacek@redhat.com>

Marek> 	PR c/61212
Marek> 	* files.c (find_file_in_dir): Add parens around &&.

Ok.  Thanks.

Tom

Patch

diff --git gcc/files.c gcc/files.c
index ad68682..91bc9dd 100644
--- gcc/files.c
+++ gcc/files.c
@@ -390,7 +390,7 @@  find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
       /* We try to canonicalize system headers.  For DOS based file
        * system, we always try to shorten non-system headers, as DOS
        * has a tighter constraint on max path length.  */
-      if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp
+      if ((CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp)
 #ifdef HAVE_DOS_BASED_FILE_SYSTEM
 	  || !file->dir->sysp
 #endif