[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-04-10 Thread Sergei Barannikov via Phabricator via cfe-commits
barannikov88 added a comment. In D144218#4255686 , @aaron.ballman wrote: > In D144218#4254021 , @barannikov88 > wrote: > >> There is something wrong with the `#if`s in the test, isn't it? They all >> look no-op

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-04-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D144218#4254021 , @barannikov88 wrote: > There is something wrong with the `#if`s in the test, isn't it? They all look > no-op. Those are verifying that the macro expands to a value that can be used by the preprocesso

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-04-09 Thread Sergei Barannikov via Phabricator via cfe-commits
barannikov88 added a comment. There is something wrong with the `#if`s, isn't it? They all look no-op. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144218/new/ https://reviews.llvm.org/D144218 ___ cfe-c

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-27 Thread Daniel Thornburgh via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG0fecac18ffad: [Clang] [AVR] Fix USHRT_MAX for 16-bit int. (authored by mysterymath). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-27 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath added a comment. Thanks for your help in getting this right! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144218/new/ https://reviews.llvm.org/D144218 ___ cfe-commits mailing list cfe-commit

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-27 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath updated this revision to Diff 500861. mysterymath marked an inline comment as done. mysterymath added a comment. Add C++ version of test for AVR. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144218/new/ https://reviews.llvm.org/D144218

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM with a small change to the test coverage. Comment at: clang/test/Headers/limits.cpp:8 +// Specifically test 16-bit int platforms. +// RUN: %clang_cc1 -trip

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-25 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath updated this revision to Diff 500442. mysterymath added a comment. Minor clarification to release note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144218/new/ https://reviews.llvm.org/D144218 Files: clang/docs/ReleaseNotes.rst c

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-24 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath updated this revision to Diff 500264. mysterymath marked an inline comment as done. mysterymath added a comment. Update condition; move release note to AVR section. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144218/new/ https://revie

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-24 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath added inline comments. Comment at: clang/docs/ReleaseNotes.rst:43-45 +- The definition of ``USHRT_MAX`` in the freestanding no longer + overflows on AVR (where ``sizeof(unsigned int) == sizeof(unsigned short)``). + The type of ``USHRT_MAX`` on AVR is now ``unsi

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-24 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: jyknight, clang-language-wg. aaron.ballman added inline comments. Comment at: clang/docs/ReleaseNotes.rst:43-45 +- The definition of ``USHRT_MAX`` in the freestanding no longer + overflows on AVR (where ``sizeof(unsigned int) == sizeof(unsigne

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-23 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath updated this revision to Diff 499922. mysterymath added a comment. Use #if to select between signed and unsigned USHRT_MAX. Add tests for the types of limit macros specified by the standard. Add tests that limit macros can be used in #if. Repository: rG LLVM Github Monorepo CHANG

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-23 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath marked an inline comment as done. mysterymath added inline comments. Comment at: clang/lib/Headers/limits.h:55 #define UCHAR_MAX (__SCHAR_MAX__*2 +1) -#define USHRT_MAX (__SHRT_MAX__ *2 +1) +#define USHRT_MAX (__SHRT_MAX__ * 2U + 1U) #define UINT_MAX (__INT_MAX__

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Headers/limits.h:55 #define UCHAR_MAX (__SCHAR_MAX__*2 +1) -#define USHRT_MAX (__SHRT_MAX__ *2 +1) +#define USHRT_MAX (__SHRT_MAX__ * 2U + 1U) #define UINT_MAX (__INT_MAX__ *2U +1U) mysterymath wrot

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-22 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath marked an inline comment as done. mysterymath added inline comments. Comment at: clang/lib/Headers/limits.h:55 #define UCHAR_MAX (__SCHAR_MAX__*2 +1) -#define USHRT_MAX (__SHRT_MAX__ *2 +1) +#define USHRT_MAX (__SHRT_MAX__ * 2U + 1U) #define UINT_MAX (__INT_MAX__

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-22 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath updated this revision to Diff 499659. mysterymath added a comment. Corrected type of USHRT_MAX. Added tests and release notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144218/new/ https://reviews.llvm.org/D144218 Files: clang/do

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. The changes need some test coverage and a release note. Comment at: clang/lib/Headers/limits.h:55 #define UCHAR_MAX (__SCHAR_MAX__*2 +1) -#define USHRT_MAX (__SHRT_MAX__ *2 +1) +#define USHRT_MAX (__SHRT_MAX__ * 2U + 1U) #define UINT_MAX (__I

[PATCH] D144218: [Clang] [AVR] Fix USHRT_MAX for 16-bit int.

2023-02-16 Thread Daniel Thornburgh via Phabricator via cfe-commits
mysterymath created this revision. mysterymath added reviewers: aaron.ballman, aykevl, dylanmckay. Herald added a subscriber: Jim. Herald added a project: All. mysterymath requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. For AVR, the definit