Opened 9 years ago

Closed 9 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:
Has a Patch: no Platform: All


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 9 years ago.
patch for supporting clang

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by TechnoMancer

Attachment: haiku_clang_patch.diff added

patch for supporting clang

comment:1 Changed 9 years ago by jackburton

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 Changed 9 years ago by TechnoMancer

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 Changed 9 years ago by andreasf

Cc: planche2k@… added

comment:4 Changed 9 years ago by Disreali

Cc: mdisreali@… added

comment:5 Changed 9 years ago by jackburton

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

comment:6 Changed 9 years ago by kaliber

According to ssize_t should be defined in <sys/types.h>

comment:7 Changed 9 years ago by TechnoMancer

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 Changed 9 years ago by korli

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

comment:9 Changed 9 years ago by TechnoMancer

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

comment:10 Changed 9 years ago by korli

Resolution: fixed
Status: newclosed

Closing then. Reopen if needed.

Note: See TracTickets for help on using tickets.