Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/reflection_test.h: add missing <stdint.h> include #7680

Merged
merged 1 commit into from Dec 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/reflection_test.h
@@ -1,6 +1,7 @@
#ifndef TESTS_REFLECTION_TEST_H
#define TESTS_REFLECTION_TEST_H

#include <stdint.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

This type is defined in the C header <stdint.h> which is part of the C++ standard sice 2011, is it necessary to import it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before C++11 you could not reliably include it as it was not a standard header. From C++11 on you can and should include it if you want to pull uint8_t into scope: stdint.h for global scope, <cstdint> for std:: scope. Standard defines the header as https://en.cppreference.com/w/cpp/types/integer

It's still not a fundamental type like int or wchar_t. Those would not require any headers. Standard defines list of fundamental types as https://en.cppreference.com/w/cpp/language/types

#include <string>

namespace flatbuffers {
Expand Down