public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/7] [libsanitizer, committed] Remove semicolon after do {} while (0) in macro body
@ 2017-11-05 10:02 Tom de Vries
  2017-11-08  8:46 ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2017-11-05 10:02 UTC (permalink / raw)
  To: GCC Patches; +Cc: Kostya Serebryany

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

Hi,

this removes a semicolon after "do {} while (0)" in several macro bodies 
in libsanitizer. This allows the macros to be used in if-then-elses 
without curly braces.

Committed as obvious.

Thanks,
- Tom

2017-11-02  Tom de Vries  <tom@codesourcery.com>

	PR other/82784
	* asan/asan_poisoning.cc (CHECK_SMALL_REGION): Remove semicolon
	after "do {} while (0)".
	* lsan/lsan_common.cc (LOG_POINTERS, LOG_THREADS): Same.

Signed-off-by: Tom de Vries <tom@codesourcery.com>
---
      libsanitizer/asan/asan_poisoning.cc | 2 +-
      libsanitizer/lsan/lsan_common.cc    | 4 ++--
      2 files changed, 3 insertions(+), 3 deletions(-)



[-- Attachment #2: 0001-libsanitizer-Remove-semicolon-after-do-while-0-in-ma.patch --]
[-- Type: text/x-patch, Size: 1398 bytes --]

diff --git a/libsanitizer/asan/asan_poisoning.cc b/libsanitizer/asan/asan_poisoning.cc
index 15cd8ea..1343dfb 100644
--- a/libsanitizer/asan/asan_poisoning.cc
+++ b/libsanitizer/asan/asan_poisoning.cc
@@ -215,7 +215,7 @@ uptr __asan_region_is_poisoned(uptr beg, uptr size) {
       uptr __bad = __asan_region_is_poisoned(__p, __size);    \
       __asan_report_error(pc, bp, sp, __bad, isWrite, __size, 0);\
     }                                                         \
-  } while (false);                                            \
+  } while (false)
 
 
 extern "C" SANITIZER_INTERFACE_ATTRIBUTE
diff --git a/libsanitizer/lsan/lsan_common.cc b/libsanitizer/lsan/lsan_common.cc
index a3274d5..4afce9d 100644
--- a/libsanitizer/lsan/lsan_common.cc
+++ b/libsanitizer/lsan/lsan_common.cc
@@ -55,12 +55,12 @@ void RegisterLsanFlags(FlagParser *parser, Flags *f) {
 #define LOG_POINTERS(...)                           \
   do {                                              \
     if (flags()->log_pointers) Report(__VA_ARGS__); \
-  } while (0);
+  } while (0)
 
 #define LOG_THREADS(...)                           \
   do {                                             \
     if (flags()->log_threads) Report(__VA_ARGS__); \
-  } while (0);
+  } while (0)
 
 ALIGNED(64) static char suppression_placeholder[sizeof(SuppressionContext)];
 static SuppressionContext *suppression_ctx = nullptr;






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/7] [libsanitizer, committed] Remove semicolon after do {} while (0) in macro body
  2017-11-05 10:02 [PATCH 1/7] [libsanitizer, committed] Remove semicolon after do {} while (0) in macro body Tom de Vries
@ 2017-11-08  8:46 ` Jakub Jelinek
  2017-11-08 13:46   ` Tom de Vries
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2017-11-08  8:46 UTC (permalink / raw)
  To: Tom de Vries; +Cc: GCC Patches, Kostya Serebryany

On Sun, Nov 05, 2017 at 11:02:32AM +0100, Tom de Vries wrote:
> this removes a semicolon after "do {} while (0)" in several macro bodies in
> libsanitizer. This allows the macros to be used in if-then-elses without
> curly braces.
> 
> Committed as obvious.

This is wrong, these files are copied directly from upstream, so if you
want those changes, you'd need to submit it into the LLVM phabricator,
get it approved there.  Otherwise these changes will go away next time
merge from upstream is performed.

> 2017-11-02  Tom de Vries  <tom@codesourcery.com>
> 
> 	PR other/82784
> 	* asan/asan_poisoning.cc (CHECK_SMALL_REGION): Remove semicolon
> 	after "do {} while (0)".
> 	* lsan/lsan_common.cc (LOG_POINTERS, LOG_THREADS): Same.
> 
> Signed-off-by: Tom de Vries <tom@codesourcery.com>
> ---
>      libsanitizer/asan/asan_poisoning.cc | 2 +-
>      libsanitizer/lsan/lsan_common.cc    | 4 ++--
>      2 files changed, 3 insertions(+), 3 deletions(-)

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/7] [libsanitizer, committed] Remove semicolon after do {} while (0) in macro body
  2017-11-08  8:46 ` Jakub Jelinek
@ 2017-11-08 13:46   ` Tom de Vries
  0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2017-11-08 13:46 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: GCC Patches, Kostya Serebryany

On 11/08/2017 09:16 AM, Jakub Jelinek wrote:
> On Sun, Nov 05, 2017 at 11:02:32AM +0100, Tom de Vries wrote:
>> this removes a semicolon after "do {} while (0)" in several macro bodies in
>> libsanitizer. This allows the macros to be used in if-then-elses without
>> curly braces.
>>
>> Committed as obvious.
> 
> This is wrong, these files are copied directly from upstream, so if you
> want those changes, you'd need to submit it into the LLVM phabricator,
> get it approved there.  Otherwise these changes will go away next time
> merge from upstream is performed.

Thanks for pointing this out.

Filed:
- https://reviews.llvm.org/D39793
   "[asan] Remove semicolon after do {} while (0)"
- https://reviews.llvm.org/D39794
   "[lsan] Remove semicolon after do {} while (0)"

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-08 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-05 10:02 [PATCH 1/7] [libsanitizer, committed] Remove semicolon after do {} while (0) in macro body Tom de Vries
2017-11-08  8:46 ` Jakub Jelinek
2017-11-08 13:46   ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).