mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <idunham@lavabit.com>
To: musl@lists.openwall.com
Subject: FTBFS on i386: aio_cancel.c relies on macro-protected defines in aio.h
Date: Tue, 3 Apr 2012 16:09:25 -0700	[thread overview]
Message-ID: <20120403160925.745f0985@newbook> (raw)

aio_cancel.c won't build.
It seems one of the _*_SOURCE macros must be defined to build it, and
I'm not sure which one (guessing it's _POSIX_SOURCE or _XOPEN_SOURCE ?).

Following is the relevant output from make:
---
cc -fno-stack-protector -I./src/internal -I./include -I./arch/i386 -c
-o src/aio/aio_cancel.o src/aio/aio_cancel.c src/aio/aio_cancel.c:5:
warning: ‘struct aiocb’ declared inside parameter list
src/aio/aio_cancel.c:5: warning: its scope is only this definition or
declaration, which is probably not what you want src/aio/aio_cancel.c:
In function ‘aio_cancel’: src/aio/aio_cancel.c:13: error:
‘AIO_NOTCANCELED’ undeclared (first use in this function)
src/aio/aio_cancel.c:13: error: (Each undeclared identifier is reported
only once src/aio/aio_cancel.c:13: error: for each function it appears
in.) src/aio/aio_cancel.c:15: error: dereferencing pointer to
incomplete type src/aio/aio_cancel.c:15: error: ‘AIO_ALLDONE’
undeclared (first use in this function) make: ***
[src/aio/aio_cancel.o] Error 1
---
aio_cancel.c #include's aio.h, which does define these macros...if
appropriate defines were passed.
Relevant portions of aio.h:
---
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
/* a few lines omitted */
struct aiocb {
	int aio_fildes, aio_lio_opcode, aio_reqprio;
	volatile void *aio_buf;
	size_t aio_nbytes;
	struct sigevent aio_sigevent;
	void *__td;
	int __lock[2];
	int __err;
	ssize_t __ret;
	off_t aio_offset;
	void *__next, *__prev;
	char __dummy4[32-2*sizeof(void *)];
};

#define AIO_CANCELED 0
#define AIO_NOTCANCELED 1
#define AIO_ALLDONE 2

/* several more lines */
#endif /* _*_SOURCE */
----

Just out of curiosity, is there a reason to macro-protect headers that
are not part of ANSI C when all other flavors support them?

Isaac Dunham



             reply	other threads:[~2012-04-03 23:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03 23:09 Isaac Dunham [this message]
2012-04-03 23:16 ` Rich Felker
2012-04-04  0:18   ` Isaac Dunham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120403160925.745f0985@newbook \
    --to=idunham@lavabit.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).