On Wed, 21 Sep 2005, Joshua Hoblitt via RT wrote:

[EMAIL PROTECTED] - Fri Oct 31 12:58:45 2003]:


 An attempt to build Parrot with PIO_OS_STDIO defined (as is the case
 when you're trying to build miniparrot) dies in core_ops.c with the error
 message:

  ops/io.ops: In function `Parrot_sockaddr_s_i_s':
  ops/io.ops:497: parse error before `;'
  [etc...]

 The reason is the interaction between the sockaddr op definition:

  op sockaddr(out STR, in INT, in STR) {
    $1 = PIO_sockaddr_in(interpreter, (unsigned short)$2, $3);
    goto NEXT();
  }

 and this ifdef in io.h:

#ifdef PIO_OS_STDIO
extern INTVAL           PIO_stdio_isatty(PIOHANDLE fd);
extern INTVAL           PIO_stdio_getblksize(PIOHANDLE fd);
#  define PIO_isatty(x)   PIO_stdio_isatty(x)
#  define PIO_sockaddr_in(i,p,a)
#  define PIO_getblksize(x)   PIO_stdio_getblksize(x)
#endif

 The preprocessor turns the op definition into:

   op sockaddr(out STR, in INT, in STR) {
    $1 = ;
    goto NEXT();
  }

 which is clearly a syntax error.

 An easy fix is to wrap the offending line in #ifndef PIO_OS_STDIO ..
 #endif, but there may be a better solution.


 This bug still exists, in a slightly modified form. If PIO_OS_STDIO is
 defined, then the build fails as described above. For PIO_OS_STDIO to
 be defined, then either MINIPARROT must be defined, or
 PARROT_HAS_HEADER_UNISTD must be undefined, since PIO_OS_STDIO is set by
 the following bit of io.h:

#ifdef MINIPARROT
#  define PIO_OS_STDIO
#else
#  ifdef _WIN32
#    define PIO_OS_WIN32
#  else
#    ifdef PARROT_HAS_HEADER_UNISTD
#      define PIO_OS_UNIX
#    else
#      define PIO_OS_STDIO
#    endif
#  endif
#endif

 However, it seems like MINIPARROT isn't actually #defined by anything any
 longer; in particular, running Configure with the --miniparrot option no
 longer adds -DMINIPARROT to the CFLAGS line. Therefore, it doesn't seem
 possible to hit this problem unless we build on a system without
 unistd.h, or unless we trigger it deliberately (as I did while checking
 that the problem still existed).

 Simon

Reply via email to