**Note**: These changes are generated by hand. Review with care.
This CL changes the `absl_internal` implementations of `AsciiStrToLower()` /
`AsciiStrToUpper()` to allow `src` to be null. This can, in fact, happen if the
`string_view` passed to the public API is empty, and the implementations handle
it correctly. I have added comments noting that `src` is allowed to be null
iff the size is zero.
`-Wnonnull` diagnoses cases where a `nullptr` literal is passed to a parameter
annotated nonnull, or where `nullptr` is returned from a function whose return
type is annotated nonnull.
`-Wnullability` diagnoses cases where nullability annotations conflict, for
example between the declaration and definition of a function.
PiperOrigin-RevId: 673846759
Change-Id: I6cf3490ce13837eba9814156c420598000ecc596
- d1397431006ea1362a5914d4a90b265d0c7c6f2c Update zoneinfo files to 2024b (#300) by Bradley White <14679271+devbww@users.noreply.github.com>
- 8bdbd840e97ff32e17f25db85c82589819ad3352 Fix mingw compiler error due to missing function declarat... by Biswapriyo Nath <nathbappai@gmail.com>
- 6624659e01e73e41527d6b27036e9f79a556560f Add GitHub Actions CI (#299) by Derek Mauro <761129+derekmauro@users.noreply.github.com>
PiperOrigin-RevId: 673451051
Change-Id: Id39f2186bbdcb802d4fc4c5e21207c6f3709c56f
This makes it easier to copy-paste, without having to read the full documentation.
PiperOrigin-RevId: 670982905
Change-Id: I2f3844f30bc289053943aef3c15fdc5433203eb9
The rationale behind this being that it is close too close to the first access of the data pointed by the pointer and is of no significant improvement as seen in the benchmarks.
PiperOrigin-RevId: 670574898
Change-Id: I43a495f23871a2870f4ffd9ab9232083d9668c79
This change adds a new macro, ABSL_HARDENING_ASSERT_SLOW, which can be used for hardening assertions which have too great a performance impact to enable widely. It also adds an additional supported value for ABSL_OPTION_HARDENED to only enable assertions which are not slow. ABSL_OPTION_HARDENED=1 will continue to enable all hardening assertions, while ABSL_OPTION_HARDENED=2 will only enable assertions not marked as SLOW.
PiperOrigin-RevId: 668976425
Change-Id: I12cb209715d5b359c4093cc8c62e16794d7729b3
We enable this validation when sanitizers are enabled rather than in debug mode because debug mode can be enabled/disabled separately in different translation units, which can cause bugs for this type of validation. E.g. a hashtable that was moved from in a TU with debug enabled is then destroyed in a TU with debug disabled.
PiperOrigin-RevId: 668492783
Change-Id: Ifab6894de0890aa0a7d8ea338b53b6759b097cb1
indicate the default nullability.
This is a no-op for now (not understood by checkers), but does communicate
intention to human readers.
PiperOrigin-RevId: 668448175
Change-Id: I19802d19be9a310aa5f0dacf8b0567dd768fb830
This change adds support for unwinding stack traces on supported android platforms (NDK 33+) to absl::GetStackTrace().
PiperOrigin-RevId: 668041186
Change-Id: Ie4c4c123686050c6b81683b71fe0246e8fa75f2b
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1728
When targeting Android NDK r25 (reached EOL now, but still in some use) one gets the following error:
```
$(SOURCE_ROOT)/contrib/restricted/abseil-cpp/absl/time/time.h:1762:37: error: invalid operands to binary expression ('std::strong_ordering' and 'const std::strong_ordering')
if (auto c = lhs_hi <=> rhs_hi; c != std::strong_ordering::equal) {
```
The error indicates the lack of `operator<=>` between two `std::strong_ordering` items.
I believe that this should be controlled by `__cpp_lib_three_way_comparison` (_Three-way comparison (library support)_, see [this article](https://en.cppreference.com/w/cpp/feature_test)), not by `__cpp_impl_three_way_comparison` (which stands for _Three-way comparison (compiler support)_).
Fixes#1725.
The problem was introduced in a27662352e.
Merge 32e1d3d889 into 69c4683962
Merging this change closes#1728
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1728 from georgthegreat:fix-time 32e1d3d889
PiperOrigin-RevId: 663723253
Change-Id: I29f7d2b562cc5ad8e11cd46b538ba69acee0f314
This fixes the behavior of
```c++
ABSL_RAW_LOG(INFO, "RAW INFO: %s%c%s", "Hello", 0, "World");
```
which would previously truncate at the `\0`. The new behavior is consistent with `printf`.
PiperOrigin-RevId: 663049889
Change-Id: I171dcb8a61b19873b88920e383f03acf7fb112d7
The motivation for renaming AssertValidCapacity() is to avoid confusion with IsValidCapacity().
PiperOrigin-RevId: 662178137
Change-Id: If4fd15725376a899c4f40afc3db9e300c8c1edc7
The GetTID() now uses the value of the current thread handle from
zx_thread_self() on Fuchsia for the thread ID. This is better than the default
implementation which uses pthread_self(), since that results in a 64-bit
pointer being truncated into the 32-bit pid_t type.
PiperOrigin-RevId: 660270084
Change-Id: I7c8b4a26cca775be62eb6f6926cb734cbb893585
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1738
Since #1707 and #1710, `-Xarch_` option groups are present as single elements in the libraries' COPTS, and a `SHELL:` prefix is added to each of them. While these addressed certain build issues, they broke the handling of `-Xarch_` option groups in pkgconfig files.
Fix that by taking care of the `SHELL:` prefix in COPTS when generating pkgconfig files. The skip-next-flag mechanism is also removed as the option groups are now present as single elements.
Merge fd1246acbf into 08850701d2
Merging this change closes#1738
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1738 from ZhongRuoyu:pkgconfig-xarch-handling fd1246acbf
PiperOrigin-RevId: 660055129
Change-Id: I57a1a51b2eb8983d076a3d5336acef12acae4560
An `operator->` that doesn't return a record type doesn't really serve a useful
purpose, and it is not required by the iterator concepts. I haven't been able
to find any usage in non-test code, so I'm removing it.
Even though the `pointer` type alias is now not being used anywhere, I'm keeping
it because otherwise some standard libraries don't accept `CharIterator` when
passed to `std::string::apend()`, for example.
PiperOrigin-RevId: 659832167
Change-Id: I5de183a01009bfd71c8477f2023973075be8d860
This change marks Abseil's non-modifying sequence operations including
absl::linear_search and absl::c_linear_search as constexpr when building with
C++20.
PiperOrigin-RevId: 659812405
Change-Id: I8dc2cee873f30531b2eb8fb3da12085505a43a1a
warnings in headers". It should fall through to the "don't impose our
warnings on others" case. Do this by matching on "-Wno-*" instead of
"-Wno*".
Fixes#1737
PiperOrigin-RevId: 659548798
Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
This updates to a version of GoogleTest that fixes
https://github.com/google/googletest/issues/4581
for downstream users of rules_python
PiperOrigin-RevId: 658398482
Change-Id: I4c6d431fd38d3a108e3c252eb26be9d81ff05a8e
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1735
If asan is enabled with VS, the following warning is issued by the compiler:
1>C:\work\abseil-cpp\absl\debugging\leak_check.cc(46,68): error C4800: Implicit conversion from 'int' to bool. Possible information loss
1> C:\work\abseil-cpp\absl\debugging\leak_check.cc(46,68):
1> consider using explicit cast or comparison to 0 to avoid this warning
Merge 9a6a677add into 8cdf482136
Merging this change closes#1735
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1735 from pps83:master-int-bool-warn 9a6a677add
PiperOrigin-RevId: 657591557
Change-Id: I709424b5064160860186a42f854a1856465e80d0
We already have `swap(raw_hash_set&, raw_hash_set&)` thus we may expect argument dependent lookup will use that function in following code snippet:
```
absl::flat_hash_map<...> x, y;
using std::swap;
swap(x, y);
```
But in practice `std::swap` will be called because `swap(raw_hash_set&, raw_hash_set&)` requires derived-to-base conversion while `std::swap` doesn't (it is a function template), thus `std::swap` is picked by compiler.
To avoid this, we need a `swap` implementations which accept the exact `*_hash_*` types which is more preferred over `std::swap`.
Note that this will fix issues#1571.
PiperOrigin-RevId: 657419420
Change-Id: Id003b2129187ce2d4583029789ff96247d1490de
Many compiler optimizations, even some in Asan, assume that size of
the object on the stack is fixed. Compiler takes into account the lifetime
of the stack object, but it does not expect that size of the object can
change.
This assumption allow to accesses when ever object is alive.
However, this assumption does not work well with custom poisoning
of objects by sanitizers. `Cord` may poison parts of the object
to improve a precision of the bug detection. But compiler still may
load from poisoned parts of the object, assuming it's alive.
So without the patch we can have `false-positive`, because
compiler reordered load from poisoned local before size-check.
https://github.com/llvm/llvm-project/issues/100639
Alternative is to make compiler optimization to know about
possibility of local object resize, but it's not worth of effort,
as it's needed only for sanitizers so far.
Another minor issue fixed with this patch is `false-negative`.
https://github.com/llvm/llvm-project/issues/100640
Asan drops instrumentation of memory accesses proven to be inbound
of local variable. However if we if we take into account `custom
poisoning` we will have to pessimize too often: any random function
call can potentially `resize` a variable by `poisoning`.
We are already using similar `poisoning` workaround in libc++:
https://github.com/llvm/llvm-project/pull/79536/files#diff-534bc2907ddb3b074ded1353d18fd7d578daf1707943b3039bab4ed975aba3b3R772
PiperOrigin-RevId: 656129711
Change-Id: I6d78997da6d31c7ab979a00b84dc9b3b7cffc26f