This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 3/6] Move mkdir_recursive to common/filestuff.c


On 2018-10-18 6:30 p.m., Tom Tromey wrote:
> This moves mkdir_recursive from dwarf-index-cache.c to
> common/filestuff.c, and also changes it to return a boolean that says
> whether or not it worked.
> 
> gdb/ChangeLog
> 2018-10-18  Tom Tromey  <tom@tromey.com>
> 
> 	* unittests/mkdir-recursive-selftests.c: New file.
> 	* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
> 	unittests/mkdir-recursive-selftests.c.
> 	* dwarf-index-cache.c (mkdir_recursive): Move to
> 	common/filestuff.c.
> 	(index_cache::store): Check return value of mkdir_recursive.
> 	(create_dir_and_check, test_mkdir_recursive): Move to new file.
> 	(_initialize_index_cache): Don't register test.
> 	* common/filestuff.h (mkdir_recursive): Declare.
> 	* common/filestuff.c (mkdir_recursive): Move from
> 	dwarf-index-cache.c.  Return bool.

I just stumbled on a build failure caused by this patch, when building for mingw:

  CXX    unittests/mkdir-recursive-selftests.o
/home/emaisin/src/binutils-gdb/gdb/unittests/mkdir-recursive-selftests.c: In function ‘void selftests::mkdir_recursive::test()’:
/home/emaisin/src/binutils-gdb/gdb/unittests/mkdir-recursive-selftests.c:49:20: error: ‘mkdtemp’ was not declared in this scope
   if (mkdtemp (base) == NULL)
                    ^

The function in the original code was guarded by HAVE_MKDTEMP (the register_test
call still is).  So I guess the function should be put back in an ifdef, or we
should import the mkdtemp gnulib module (I don't remember why I chose not to do
that).

Simon

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]