bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: examples/loadables/getconf.c


From: Greg Wooledge
Subject: Re: examples/loadables/getconf.c
Date: Fri, 5 Oct 2012 11:27:34 -0400
User-agent: Mutt/1.4.2.3i

On Fri, Oct 05, 2012 at 05:20:23PM +0200, Andreas Schwab wrote:
> Greg Wooledge <address@hidden> writes:
> 
> > Line 1209 says:
> > #  if (ULLONG_MAX != LLONG_MAX)
> >
> > LLONG_MAX expands to:
> > ((long long int) (~ (long long int) 0 - ((long long int) ((! ((long long 
> > int) 0 < (long long int) -1)) ? ~ (long long int) 0 << (sizeof (long long 
> > int) * 8 - 1) : (long long int) 0))))
> 
> That's not a valid expansion for this macro, it cannot contain casts or
> the sizeof operator.

Then there's a serious problem somewhere, because that's what gcc -E is
giving me.  Copying the top part of getconf.c and then jumping straight
to the heart of the matter:

imadev:/var/tmp/bash/bash-4.2/examples/loadables$ cat foo.c
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#ifdef HAVE_SYS_PARAM_H
#  include <sys/param.h>
#endif

#include <stdio.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <errno.h>

#include "typemax.h"

#include "bashansi.h"
#include "shell.h"
#include "builtins.h"
#include "stdc.h"
#include "common.h"
#include "bashgetopt.h"

#include "getconf.h"

#ifndef errno
extern int errno;
#endif

LLONG_MAX
imadev:/var/tmp/bash/bash-4.2/examples/loadables$ /net/appl/gcc-3.3/bin/gcc 
-fpic -DHAVE_CONFIG_H -DSHELL -DHPUX -g -O2 -I. -I.. -I../.. -I../../lib 
-I../../builtins -I../../include -I/var/tmp/bash/bash-4.2 
-I/var/tmp/bash/bash-4.2/lib -I/var/tmp/bash/bash-4.2/builtins -I../../lib/intl 
-I/var/tmp/bash/bash-4.2/lib/intl -E foo.c | tail
# 29 "foo.c" 2

# 1 "getconf.h" 1
# 31 "foo.c" 2


extern int errno;


((long long int) (~ (long long int) 0 - ((long long int) ((! ((long long int) 0 
< (long long int) -1)) ? ~ (long long int) 0 << (sizeof (long long int) * 8 - 
1) : (long long int) 0))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]