Matthew Woehlke wrote: > Jim Meyering wrote: >> It's saying that with its default settings, the post-cpp-expansion of >> this code is too large: >> [snip] > > I know what the problem is; as I was saying, I didn't find a way to > get past this type of error except "don't do that", i.e. break down > what cpp is seeing into manageable bites. > > How about the attached work-around (obviously '#if 1' should be > changed to something more like '#if using-the-hp-ux-cc-compiler')? > > (Build succeeds with this, using HP-UX's cc. I'll post the test > results when the suite is done.)
How about this instead? >From 122169078df3a1dfa1e083c2e1bfdac83ae28c52 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Thu, 19 Mar 2009 20:14:26 +0100 Subject: [PATCH] dd: use a more portable definition of O_FULLBLOCK * src/dd.c (O_FULLBLOCK): Compute its value via two separate expressions to avoid a compiler limitation. Reported by Matthew Woehlke. --- src/dd.c | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/dd.c b/src/dd.c index 9a1c875..8a814f7 100644 --- a/src/dd.c +++ b/src/dd.c @@ -265,20 +265,25 @@ static struct symbol_value const conversions[] = enum { - /* Use a value that is larger than that of any other O_ symbol. */ - O_FULLBLOCK = ((MAX (O_APPEND, - MAX (O_BINARY, - MAX (O_CIO, - MAX (O_DIRECT, - MAX (O_DIRECTORY, - MAX (O_DSYNC, - MAX (O_NOATIME, - MAX (O_NOCTTY, - MAX (O_NOFOLLOW, - MAX (O_NOLINKS, - MAX (O_NONBLOCK, - MAX (O_SYNC, - MAX (O_TEXT, 0)))))))))))))) << 1) + /* Use a value that is larger than that of any other O_ symbol. + Do it in two steps to avoid hitting a cpp expansion size limit + in the vendor compiler from HP-UX 11.23. */ + M1 = (MAX (O_APPEND, + MAX (O_BINARY, + MAX (O_CIO, + MAX (O_DIRECT, + MAX (O_DIRECTORY, + MAX (O_DSYNC, 0))))))), + + M2 = (MAX (O_NOATIME, + MAX (O_NOCTTY, + MAX (O_NOFOLLOW, + MAX (O_NOLINKS, + MAX (O_NONBLOCK, + MAX (O_SYNC, + MAX (O_TEXT, 0)))))))), + + O_FULLBLOCK = (MAX (M1, M2) << 1) }; /* Ensure that we didn't shift it off the end. */ -- 1.6.2.rc1.285.gc5f54 _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils