Opened 15 years ago

Closed 14 years ago

#5719 closed enhancement (fixed)

fix a header incompatibility with clang

Reported by: TechnoMancer Owned by: nobody
Priority: normal Milestone: R1
Component: System/POSIX Version: R1/alpha1
Keywords: clang ssize_t Cc: planche2k@…, mdisreali@…
Blocked By: Blocking:
Platform: All

Description

This patch fixes an incompatibility with clang it defines ssize_t as in the comment in the file if being compiled with clang.

Attachments (1)

haiku_clang_patch.diff (426 bytes ) - added by TechnoMancer 15 years ago.
patch for supporting clang

Download all attachments as: .zip

Change History (11)

by TechnoMancer, 15 years ago

Attachment: haiku_clang_patch.diff added

patch for supporting clang

comment:1 by jackburton, 15 years ago

If you see the comment just after the lines you've added, you'll see that we should probably do that regardless of the compiler, and it's gcc's stddef.h which defines ssize_t while it shouldn't.

comment:2 by TechnoMancer, 15 years ago

That is indeed true, however this makes clang work now. If someone wishes to fix haiku's gcc to not define ssize_t and then make the definition unconditional that is fine and would be appreciated but I am unfamiliar with gcc and would appreciate it if this patch could be applied in the mean time so that clang will work out of the box on haiku.

comment:3 by andreasf, 15 years ago

Cc: planche2k@… added

comment:4 by Disreali, 15 years ago

Cc: mdisreali@… added

comment:5 by jackburton, 15 years ago

Maybe zooey could have a look at what I wrote in comment #1

comment:6 by kaliber, 15 years ago

According to http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html ssize_t should be defined in <sys/types.h>

comment:7 by TechnoMancer, 15 years ago

sys/types.h includes size_t.h to get that def and some others I believe... I think the change should be made there, make the def of ssize_t there unconditional and remove it from gcc's stddef.h

comment:8 by korli, 14 years ago

Applied a change in hrev37380. I hope it's also valid for clang. Please check.

comment:9 by TechnoMancer, 14 years ago

It will be as clang pretends to be GCC defining __GNUC__ to be 4

comment:10 by korli, 14 years ago

Resolution: fixed
Status: newclosed

Closing then. Reopen if needed.

Note: See TracTickets for help on using tickets.