Opened 14 years ago

Closed 14 years ago

#1792 closed defect (invalid)

Detection of swab(3) fails on OpenSolaris => build fails.

Reported by: vle@… Owned by: diego@…
Priority: normal Component: build system
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

On OpenSolaris building the following code

#define _XOPEN_SOURCE 600
#include <unistd.h>
int main(void) { swab(0, 0, 0); return 0; }

used in configure script fails with the following error message.

"/usr/include/sys/feature_tests.h", line 357: #error: "Compiler or options
invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99"
cc: acomp failed for main.c

As a result swab is marked as "absent" and later an entire build fails
due to different declarations of mplayer's swab and swab from SunOS's stdlib.h.

Solution: on OpenSolaris (and probably Solaris too), a declaration for swab(3)
( void swab(const char *src, char *dest, ssize_t nbytes); )
is available in stdlib.h without any defines. That is

#include <unistd.h>
#include <stdlib.h>
int main(void) { swab(0, 0, 0); return 0; }

whould be enough.

Change History (2)

comment:1 by diego@…, 14 years ago

Status: newassigned

The POSIX spec tells me that _XOPEN_SOURCE is required for swab():
http://www.opengroup.org/onlinepubs/009695399/functions/swab.html

Anyway, I made some changes to the way that compiler flags are handled during compilation checks in configure. Please let me know if this fixed your problem or not.

comment:2 by diego@…, 14 years ago

Resolution: invalid
Status: assignedclosed

It's not clear what the ensuing error is and how it could be worked around on our side (cleanly). I'm also not sure what your compiler is. So in summary this looks like an issue in OpenSolaris. I'm closing this as INVALID, but please do reopen if you can provide further information.

Note: See TracTickets for help on using tickets.