patchWeeChat - Patches: patch #5271, multiple build fixes mostly...


patch #5271: multiple build fixes mostly related to portability

Submitter:  None
Submitted:  Mon 31 Jul 2006 03:50:09 PM UTC
Category:  compilation Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  flashcode Originator Email:  -email is unavailable-
Open/Closed:  Closed IRC nick: 
* Mandatory Fields

Add a New Comment Rich Markup

Thu 12 Oct 2006 05:17:59 PM UTC, comment #1: 

Sorry for long delay before merging this patch to cvs ;)

Sebastien Helleu <flashcode>
Group administrator
Mon 31 Jul 2006 03:50:09 PM UTC, original submission:  

the attached patch addresses multiple issues i encounted while building on my system, which is a fairly strict posix/c implementation running on top of the linux kernel. in particular GNU and BSD extensions are not supported. compared to many packages weechat was very well-behaved and portable, but here are a few changes i had to make to get it to compile. hopefully these will be useful to users on other systems as well:

1. weechat_backtrace_addr2line was defined even if HAVE_BACKTRACE was disabled, causing errors due to missing types.

2. sys/file.h is not portable and is part of the BSD flock interface. including it can break build on systems without flock. (it might be nice to also support the standard locking system, fcntl/lockf, but that can come in a separate patch.)

3. the "rt" and "wt" flags to open are not documented anywhere except some ancient DOS C implementations for "text mode". text mode is the default mode anyway (on systems where there's a difference between text and binary) so these are not needed. on my system using "rt" and "wt" causes all file opens to fail at runtime due to invalid flags (EINVAL).

4. struct timezone is declared but not used. posix does not define struct timezone (the second argument to gettimeofday is type void*) and says that the behavior is unspecified if anything but NULL is passed as the second argument. my system does not have struct timezone so this breaks the build. removing it saves a few bytes of code and stack space and cannot cause any harm.

5. NI_MAXHOST seems to be a linux or BSD extension. it's not documented and breaks build on my system. DNS defines the max length for any hostname to be 255 bytes so using 256 will always work in practice. A more elegant solution may be #ifndef NI_MAXHOST #define NI_MAXHOST 256 #endif or similar. ideally HOST_NAME_MAX (from limits.h) should be used, but some older non-posix-compliant systems lack that.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #10443:  weechat-portability.diff added by None (8KiB - application/octet-stream - diff is against 0.1.9)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.


Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-10-12 flashcode StatusNone Done
    Assigned toNone flashcode
    Open/ClosedOpen Closed
2006-07-31 None Attached File- Added weechat-portability.diff, #10443

Back to the top

Powered by Savane 3.12