[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/8] obstack: port --enable-gcc-warnings to clang
From: |
Paul Eggert |
Subject: |
[PATCH 6/8] obstack: port --enable-gcc-warnings to clang |
Date: |
Wed, 15 May 2013 00:37:59 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
* lib/obstack.h (obstack_ptr_grow_fast, obstack_int_grow_fast):
Avoid casts from looser to stricter-aligned pointers.
---
ChangeLog | 4 ++++
lib/obstack.h | 6 ++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f637cda..35a57b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2013-05-15 Paul Eggert <address@hidden>
+ obstack: port --enable-gcc-warnings to clang
+ * lib/obstack.h (obstack_ptr_grow_fast, obstack_int_grow_fast):
+ Avoid casts from looser to stricter-aligned pointers.
+
memchr2: port --enable-gcc-warnings to clang
* lib/memchr2.c (memchr2):
Avoid casts from looser to stricter-aligned pointers.
diff --git a/lib/obstack.h b/lib/obstack.h
index 159cfa2..7cf98ed 100644
--- a/lib/obstack.h
+++ b/lib/obstack.h
@@ -342,14 +342,16 @@ __extension__
\
# define obstack_ptr_grow_fast(OBSTACK,aptr) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
- *(const void **) __o1->next_free = (aptr); \
+ void *__p1 = __o1->next_free; \
+ *(const void **) __p1 = (aptr); \
__o1->next_free += sizeof (const void *); \
(void) 0; })
# define obstack_int_grow_fast(OBSTACK,aint) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
- *(int *) __o1->next_free = (aint); \
+ void *__p1 = __o1->next_free; \
+ *(int *) __p1 = (aint); \
__o1->next_free += sizeof (int); \
(void) 0; })
--
1.7.11.7
- Re: [libvirt] [PATCH 4/6] Correctly detect warning flags with clang, Eric Blake, 2013/05/13
- Re: [libvirt] [PATCH 4/6] Correctly detect warning flags with clang, Paul Eggert, 2013/05/15
- [PATCH 2/8] inttostr: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 3/8] malloca: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 4/8] mbsstr: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 5/8] memchr2: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 6/8] obstack: port --enable-gcc-warnings to clang,
Paul Eggert <=
- [PATCH 7/8] sig2str: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- Re: [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Eric Blake, 2013/05/15
- Re: [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 1/4] stdio: use __REDIRECT for fwrite, fwrite_unlocked, Paul Eggert, 2013/05/15
- Re: [PATCH 1/4] stdio: use __REDIRECT for fwrite, fwrite_unlocked, Eric Blake, 2013/05/16
- [PATCH 2/4] thread: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 3/4] getaddrinfo-tests: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 4/4] spawn-tests, sys_socket-tests, sys_wait-tests: port to clang, Paul Eggert, 2013/05/15