Commit bfc16654 by Thomas Koenig

re PR fortran/55919 (Bogus warning with -J directory/)

2013-01-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/55919
	* scanner.c (add_path_to_list): Copy path to temporary and strip
	trailing directory separators before calling stat().

2013-01-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/55919
	* gfortran.dg/include_8.f90:  New test.

From-SVN: r195348
parent 62e89681
2013-01-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55919
* gfortran.dg/include_8.f90: New test.
2013-01-17 Richard Biener <rguenther@suse.de>
* trans-stmt.c (gfc_trans_do): Conditionally compute countm1
......
......@@ -310,14 +310,26 @@ add_path_to_list (gfc_directorylist **list, const char *path,
{
gfc_directorylist *dir;
const char *p;
char *q;
struct stat st;
size_t len;
int i;
p = path;
while (*p == ' ' || *p == '\t') /* someone might do "-I include" */
if (*p++ == '\0')
return;
if (stat (p, &st))
/* Strip trailing directory separators from the path, as this
will confuse Windows systems. */
len = strlen (p);
q = (char *) alloca (len + 1);
memcpy (q, p, len + 1);
i = len - 1;
while (i >=0 && IS_DIR_SEPARATOR(q[i]))
q[i--] = '\0';
if (stat (q, &st))
{
if (errno != ENOENT)
gfc_warning_now ("Include directory \"%s\": %s", path,
......
2013-01-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55919
* add_path_to_list: Copy path to temporary and strip
trailing directory separators before calling stat().
2012-01-21 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/tree-ssa/pr55579.c: Cleanup esra tree dump.
......
! { dg-do compile }
! { dg-options "-J./" }
! PR 55919 - a trailing dir separator would cause a warning
! on Windows.
program main
end program main
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment