---
Source/GSSocketStream.m | 7 +++++--
Source/NSPropertyList.m | 5 +++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Source/GSSocketStream.m b/Source/GSSocketStream.m
index fd4f473..d7d1025 100644
--- a/Source/GSSocketStream.m
+++ b/Source/GSSocketStream.m
@@ -2512,8 +2512,11 @@ setNonBlocking(SOCKET fd)
{
GSSocketStream *ins = AUTORELEASE([[self _inputStreamClass] new]);
GSSocketStream *outs = AUTORELEASE([[self _outputStreamClass] new]);
- uint8_t buf[BUFSIZ];
- struct sockaddr *addr = (struct sockaddr*)buf;
+ // fix buffer alignment
+ struct aligned_buffer_t {
+ uint8_t __b[BUFSIZ];
+ } __attribute__((aligned (2))) buf;
+ struct sockaddr *addr = (struct sockaddr*)&buf;
socklen_t len = sizeof(buf);
int acceptReturn;
diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m
index fc08f93..59d4e44 100644
--- a/Source/NSPropertyList.m
+++ b/Source/NSPropertyList.m
@@ -3721,7 +3721,12 @@ isEqualFunc(const void *item1, const void *item2,
offset = [dest length];
[dest setLength: offset + sizeof(unichar)*len];
buffer = [dest mutableBytes] + offset;
+ // Fix alignment warning. This warning can safely
+ // be ignored since offset is always aligned with unichar.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-align"
[string getCharacters: (unichar*)buffer];
+#pragma GCC diagnostic pop
// Always store in big-endian, so if machine is little-endian,
// perform byte-swapping.
_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev