Skip to content

-std=gnu++98 does not imply "no thread-syncing on static locals" #4476

Description

@steven-johnson

A Googler comments:

-std=gnu++98 has no effect on whether the compiler produces synchronization for function-local statics. This is because gcc had the support prior to the standard anyway. c++11 just mandated the behavior for everyone; this affected primarily Microsoft.

Example on Haswell x64: https://gcc.godbolt.org/z/Dzx9tU

Example on RISC-V: https://gcc.godbolt.org/z/ATXUYH

If you don't want synchronization, the flag you should use is -fno-threadsafe-statics, example => https://gcc.godbolt.org/z/8ej1iO

Metadata

Metadata

Assignees

Labels

buildIssues related to building Halide and with CI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions