Skip to content

[cstdint, cinttypes.syn] Reorganize <cstdint> presentation #843

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 27 additions & 28 deletions source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1872,42 +1872,41 @@
using uintptr_t = @\textit{unsigned integer type}@; // optional
}

#define INT@\placeholdernc{N}@_MIN @\seebelow@
#define INT@\placeholdernc{N}@_MAX @\seebelow@
#define UINT@\placeholdernc{N}@_MAX @\seebelow@
#define INT[8, 16, 32, 64]_MIN @\seebelow@ // optional
Copy link
Member

Choose a reason for hiding this comment

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

These did not appear to be optional before.

I do not think we can fix this editorially; we need to ask LWG what they meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These macros are supposed to expand to expressions of their corresponding type. Since the corresponding type is optional, surely the macro must also be optional?

But indeed the LEAST/FAST macros should absolutely not be optional, that's a mistake that I will fix at once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will open an LWG issue to have the question settled of whether the macros are optional.

#define INT[8, 16, 32, 64]_MAX @\seebelow@ // optional
#define UINT[8, 16, 32, 64]_MAX @\seebelow@ // optional

#define INT_FAST@\placeholdernc{N}@_MIN @\seebelow@
#define INT_FAST@\placeholdernc{N}@_MAX @\seebelow@
#define UINT_FAST@\placeholdernc{N}@_MAX @\seebelow@
#define INT_LEAST[8, 16, 32, 64]_MIN @\seebelow@
#define INT_LEAST[8, 16, 32, 64]_MAX @\seebelow@
#define UINT_LEAST[8, 16, 32, 64]_MAX @\seebelow@

#define INT_LEAST@\placeholdernc{N}@_MIN @\seebelow@
#define INT_LEAST@\placeholdernc{N}@_MAX @\seebelow@
#define UINT_LEAST@\placeholdernc{N}@_MAX @\seebelow@
#define INT_FAST[8, 16, 32, 64]_MIN @\seebelow@
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems worse: the never-defined pattern-matching language of "INT_[FAST LEAST]{8 16 32 64}_MIN" is both changed and used in what would otherwise be a preprocessor directive (rather than prose).

#define INT_FAST[8, 16, 32, 64]_MAX @\seebelow@
#define UINT_FAST[8, 16, 32, 64]_MAX @\seebelow@

#define INTMAX_MIN @\seebelow@
#define INTMAX_MAX @\seebelow@
#define UINTMAX_MAX @\seebelow@
#define INTPTR_MIN @\seebelow@ // optional
#define INTPTR_MAX @\seebelow@ // optional
#define UINTPTR_MAX @\seebelow@ // optional

#define INTPTR_MIN @\seebelow@ // optional
#define INTPTR_MAX @\seebelow@ // optional
#define UINTPTR_MAX @\seebelow@ // optional
#define INTMAX_MIN @\seebelow@
#define INTMAX_MAX @\seebelow@
#define UINTMAX_MAX @\seebelow@

#define PTRDIFF_MIN @\seebelow@
#define PTRDIFF_MAX @\seebelow@
#define SIZE_MAX @\seebelow@
#define PTRDIFF_MIN @\seebelow@
#define PTRDIFF_MAX @\seebelow@
#define SIG_ATOMIC_MIN @\seebelow@
#define SIG_ATOMIC_MAX @\seebelow@
#define SIZE_MAX @\seebelow@

#define SIG_ATOMIC_MIN @\seebelow@
#define SIG_ATOMIC_MAX @\seebelow@
#define WCHAR_MIN @\seebelow@
#define WCHAR_MAX @\seebelow@
#define WINT_MIN @\seebelow@
#define WINT_MAX @\seebelow@

#define WCHAR_MIN @\seebelow@
#define WCHAR_MAX @\seebelow@
#define INT[8, 16, 32, 64]_C(value) @\seebelow@ // optional
#define UINT[8, 16, 32, 64]_C(value) @\seebelow@ // optional

#define WINT_MIN @\seebelow@
#define WINT_MAX @\seebelow@

#define INT@\placeholdernc{N}@_C(value) @\seebelow@
#define UINT@\placeholdernc{N}@_C(value) @\seebelow@
#define INTMAX_C(value) @\seebelow@
#define INTMAX_C(value) @\seebelow@
#define UINTMAX_C(value) @\seebelow@
\end{codeblock}

Expand Down