Commit Graph

1414 Commits

Author SHA1 Message Date
Peter Dimov
880d430dcf Add -fsanitize=undefined configurations to Travis 2018-09-05 18:30:38 +03:00
Peter Dimov
606bfa58bf Add clang 3.3, 3.4 to Travis 2018-09-05 16:38:30 +03:00
Peter Dimov
fbf4d92955 Add g++ 4.4, 4.6, 8; clang 6 to Travis 2018-09-05 16:36:46 +03:00
Peter Dimov
d32190fab7 Remove dependency on Range 2018-09-05 08:14:32 +03:00
Peter Dimov
f13aa18a93 Fix BOOST_FOREACH support; add test 2018-09-05 07:59:20 +03:00
Daniela Engert
d88945564a
fix compiler warnings about narrowing conversions
Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-07-19 19:45:17 +02:00
datadiode
c155593fe2 path.hpp: Fix a few cases of trying to dereference (w)string::end() 2018-07-14 09:20:13 +02:00
Mike Crowe
b8d259fb88 directory_iterator_construct: Avoid provoking undefined behaviour
The directory_iterator(const path& p) constructor calls
detail::directory_iterator_construct passing nullptr (as 0) for the ec
parameter.

detail::directory_iterator_construct may call
directory_iterator::increment(*ec) which dereferences the nullptr provoking
undefined behaviour.

On GCC, and probably many other compilers, it seems that this merely causes
a null reference to be passed to directory_iterator::increment which in
turn, turns it back into nullptr when calling
detail::directory_iterator_increment which knows how to deal with the
nullptr and is happy.

Unfortunately, directory_iterator::increment(system::error_code& ec) is
marked noexcept (unlike the version that takes no arguments) but
detail::directory_iterator_increment throws exceptions when ec == nullptr.
This results in std::terminate being called.

The simplest way to fix this is for detail::directory_iterator_construct to
just pass on the potentially-nullptr ec argument to
detail::directory_iterator_increment rather than going via the
potentially-noexcept directory_iterator::increment member function.

(Discovered in the field with Boost 1.63 and a faulty disk. I managed to
reproduce the problem by teaching dir_itr_increment to pretend that
readdir_r_simulator returned an error when it saw a certain filename.)
2018-06-29 14:53:47 +01:00
Peter Dimov
5a93351bfd
Merge pull request #51 from hammond/sysconf-errno
Reset 'errno' after 'sysconf()'
2018-06-05 13:11:02 +03:00
Peter Dimov
37b324ceab Install libstdc++-4.9 on clang-4.0, 5.0 2018-05-09 20:09:23 +03:00
Peter Dimov
6f31d4e07c
Merge pull request #69 from alexeikh/pr/fix-file-offset-bits-64
Fix compilation for Android and clean up _FILE_OFFSET_BITS #if-ery
2018-05-09 18:14:24 +03:00
Andrey Semashev
f710a2fc9a Disable readdir_r on Android.
This is an explicit fix for this bug:

https://github.com/boostorg/filesystem/issues/72

Android developers recommend using readdir instead of readdir_r as it is
already thread-safe:

http://elliotth.blogspot.com/2012/10/how-not-to-use-readdirr3.html
2018-04-10 19:16:30 +03:00
Beman
cd6fead714 Upgrade MSVC Platform Toolset to 141. 2018-04-10 07:56:37 -04:00
Beman
4bd92f00bb Initial commit of Beman's Windows b2 test script 2018-04-10 07:52:04 -04:00
Rodger Combs
6fb9281d2a
Fix undefined behavior in detail::copy
Call the detail versions, which take pointers, rather than converting the pointers to references and back (which is UB).
2018-04-06 03:24:37 -05:00
Alexei Khlebnikov
3d3d504b25 Do not define _FILE_OFFSET_BITS for Android APIs < 24. 2018-03-06 23:53:03 +01:00
Alexei Khlebnikov
f721c56ea6 Improved comment about why _FILE_OFFSET_BITS should be defined for most systems. 2018-03-04 16:56:59 +01:00
Andrey Semashev
716567aa9e Added a check for whether the size argument to resize_file exceeds off_t limit.
This check is especially useful on 32-bit systems which have no support for
64-bit file offsets (like older Android).
2018-03-03 17:49:23 +01:00
Alexei Khlebnikov
b37e83640a Do not define _FILE_OFFSET_BITS for Android APIs < 21. 2018-03-03 17:35:28 +01:00
Alexei Khlebnikov
7717db0b3e Deduplicated and cleaned up _FILE_OFFSET_BITS #if-ery. 2018-03-03 16:50:57 +01:00
Alexei Khlebnikov
18c7f93440 Replaced for-internal-use macro __USE_FILE_OFFSET64 by for-public-use macro _FILE_OFFSET_BITS. 2018-03-03 16:47:54 +01:00
Alexei Khlebnikov
aea71c5864 Transformed _FILE_OFFSET_BITS #if-ery even more for better understanding. 2018-03-03 16:43:34 +01:00
Alexei Khlebnikov
e5b3740440 Transformed _FILE_OFFSET_BITS #if-ery for better understanding. 2018-03-03 16:39:18 +01:00
Andrey Semashev
48b8d753dd Don't use readdir_r on Linux.
readdir_r has been deprecated and has problems of its own[1]. glibc 2.24 marked
readdir_r as deprecated and may eventually remove it. At the same time, plain
readdir is thread-safe if different threads call it for different directory
streams, which is fine in our case.

[1]: http://man7.org/linux/man-pages/man3/readdir_r.3.html
2018-03-02 02:29:58 +03:00
Peter Dimov
d8a6730d6e Do not return a reference to NULL in poison_category(), to make the test pass on clang with variant=release 2018-01-29 19:29:53 +02:00
Peter Dimov
c6a977c99f Avoid clang warning by removing the extra parentheses 2018-01-29 19:18:05 +02:00
Peter Dimov
e3976fb3d3
Merge pull request #62 from boostorg/pr/fix-icmp-init-issues
Use ad-hoc extension comparison to avoid initialization issues
2018-01-04 05:29:18 +02:00
Peter Dimov
9a9bf767fb Fix tests to better tolerate parallel execution 2017-12-19 02:44:43 +02:00
Peter Dimov
589bfb0436 Add quick test target (for CI) 2017-12-02 17:59:21 +02:00
Peter Dimov
1290dfa1dc Add #include <boost/next_prior.hpp>; no longer in utility.hpp 2017-12-02 03:59:46 +02:00
Peter Dimov
399dd6e1d6 Use ad-hoc extension comparison to avoid initialization issues 2017-11-22 19:20:16 +02:00
Peter Dimov
669d35d8db Merge branch 'feature/fix-op-unit-test' into feature/fix-cygwin-op-test 2017-11-22 17:34:13 +02:00
Peter Dimov
03eb5df380 Use SetEnvironmentVariableW on Cygwin too 2017-11-22 16:15:26 +02:00
Peter Dimov
1dc51988bb Make operations_unit_test take a current directory argument; pass one in test/Jamfile 2017-11-22 05:05:43 +02:00
Peter Dimov
93cab09a6b Add .travis.yml, appveyor.yml 2017-11-22 03:13:45 +02:00
Beman
44ce5b8e4f Merge branch 'develop' 2017-10-30 08:48:11 -04:00
Beman
07619fb370 Add Beman's local test results to aid tracking changes over time. 2017-08-24 08:00:38 -04:00
hammond
1e8de36542 Reset 'errno' after 'sysconf()' 2017-08-23 17:36:46 +02:00
Beman
49218481e5 Clean up some tutorial example code and fix the wording for it in the tutorial. Thanks to Anmol-Singh-Jaggi for pull request #11. 2017-08-07 20:01:08 -04:00
David Olsen
e1463acb06 Update PGI C++ compiler support
Remove an #if from operations.cpp that used to be necessary for the file to compile with PGI C++, but causes compilation errors with PGI C++ compilers of the last few years.
2017-07-26 10:44:07 -07:00
Jacob Lifshay
9f926b83d9 fix ISO9660 Joliet name 2017-06-26 21:10:06 -07:00
Jacob Lifshay
e7d2e325f9 remove extraneous character in #name_check_functions 2017-06-26 21:07:46 -07:00
Beman
8a0ab2fdd9 Merge branch 'develop' 2017-04-06 07:10:42 -04:00
Beman
23b79b9459 Clear two -Wconversion warnings 2017-04-03 09:47:32 -04:00
Beman
7fd4214912 is_empty()overload with error_code parameter should not throw on error. Thanks to ldqrk for pull request #42 2017-04-03 09:36:43 -04:00
Beman
9144a8ebd7 Update release history. 2017-04-03 08:29:00 -04:00
Beman
12bcf2e6ea Merge branch 'Dani-Hub-develop' into develop 2017-04-02 16:44:25 -04:00
drgler
0e831d5c2d Extended patch for ticket #10731 and ticket #9480: Replace expensive call of RtlInitUnicodeString by wcslen and get rid of CompareStringOrdinal completely, because it has no longer any advantages. Also, replace Windows TEXT macro by selecting GetModuleHandleW with wide character argument to prevent any additional conversions. 2017-03-19 16:21:46 +01:00
drgler
14935c4c6d Extended patch for ticket #10731 and ticket #9480: Replace usage of non-portable _wcsicmp by appropriate Windows functions to realize a locale invariant case-insensitive binary Unicode comparison that match the underlying file name comparison. 2017-03-18 22:28:29 +01:00
drgler
755766a053 Patch for ticket #10731 and ticket #9480: Evaluate path.extension only once, perform (case-insensitive) string comparisons using the wchar_t variants from the CRT to prevent code conversions via path.string() calls. 2017-03-14 21:46:12 +01:00