Skip to content

[MrBot] Stop including deprecated C compatibility headers in C++ - #653

Open
Abhinandan Sharma (abhinandan-codes) wants to merge 1 commit into
masterfrom
abhinandan/remove-cpp-c-compat-headers
Open

Abhinandan Sharma (abhinandan-codes) wants to merge 1 commit into
masterfrom
abhinandan/remove-cpp-c-compat-headers

Conversation

@abhinandan-codes

Copy link
Copy Markdown

Remove <cstdbool> and <cstdalign> from the C++ branch of public and reals headers. bool, alignas and alignof are C++ keywords, and these headers are deprecated in C++17 (MSVC STL4004), which fails /WX builds. C translation units still include <stdbool.h>/<stdalign.h>.

Prerequisite for raising the default C++ standard to C++17 in Azure/c-build-tools#471.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@abhinandan-codes

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

#else
#ifndef __cplusplus
#include <stdbool.h>
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it as:

#ifdef __cplusplus
#else
#include <stdbool.h>
#endif

That's our typical convention, which means less churn if new headers are added

#else
#ifndef __cplusplus
#include <stdbool.h>
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment

#ifdef __cplusplus
#else
#include <stdbool.h>
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here and everywhere

@mattdurak Matt Durak (mattdurak) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants