Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abseil-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
abseil-cpp
Commits
541818ee
Unverified
Commit
541818ee
authored
Oct 05, 2022
by
Randolf J
Committed by
GitHub
Oct 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add clang < 7 to conditions
parent
beaec233
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
absl/strings/charconv.cc
+6
-4
No files found.
absl/strings/charconv.cc
View file @
541818ee
...
@@ -339,13 +339,15 @@ template <typename FloatType>
...
@@ -339,13 +339,15 @@ template <typename FloatType>
bool
HandleEdgeCase
(
const
strings_internal
::
ParsedFloat
&
input
,
bool
negative
,
bool
HandleEdgeCase
(
const
strings_internal
::
ParsedFloat
&
input
,
bool
negative
,
FloatType
*
value
)
{
FloatType
*
value
)
{
if
(
input
.
type
==
strings_internal
::
FloatType
::
kNan
)
{
if
(
input
.
type
==
strings_internal
::
FloatType
::
kNan
)
{
// A bug in gcc would cause the compiler to optimize away the buffer
// A bug in both clang < 7 and gcc would cause the compiler to optimize
// we are building below. Declaring the buffer volatile avoids the
// away the buffer we are building below. Declaring the buffer volatile
// issue, and has no measurable performance impact in microbenchmarks.
// avoids the issue, and has no measurable performance impact in
// microbenchmarks.
//
//
// https://bugs.llvm.org/show_bug.cgi?id=37778
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86113
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86113
constexpr
ptrdiff_t
kNanBufferSize
=
128
;
constexpr
ptrdiff_t
kNanBufferSize
=
128
;
#if
def __GNUC__
#if
defined(__GNUC__) || (defined(__clang__) && __clang_major__ < 7)
volatile
char
n_char_sequence
[
kNanBufferSize
];
volatile
char
n_char_sequence
[
kNanBufferSize
];
#else
#else
char
n_char_sequence
[
kNanBufferSize
];
char
n_char_sequence
[
kNanBufferSize
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment