This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PCH] cpp & dependencies
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Geoffrey Keating <geoffk at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, clm at redhat dot com
- Date: Mon, 2 Sep 2002 07:38:51 +0100
- Subject: Re: [PCH] cpp & dependencies
- References: <200209020034.g820YOd05048@romulus.sfbay.redhat.com>
Geoffrey Keating wrote:-
> + if (cpp_get_options (pfile)->warn_invalid_pch)
> + {
> + if (memcmp (ident, pch_ident, 5) == 0)
> + /* It's a PCH, for the right language, but has the wrong version.
> + */
> + cpp_error (pfile, DL_WARNING,
> + "%s: not compatible with this GCC version", name);
> + else if (memcmp (ident, pch_ident, 4) == 0)
> + /* It's a PCH for the wrong language. */
> + cpp_error (pfile, DL_WARNING, "%s: not for C language", name);
> + else
> + /* Not any kind of PCH. */
> + cpp_error (pfile, DL_WARNING, "%s: not a PCH file", name);
> + }
cpp_error should only be used inside cpplib.
> + case NT_MACRO:
> + if ((hn->flags & NODE_BUILTIN))
> + return 1;
> +
> + {
> + struct macrodef_struct s;
> + const unsigned char *defn;
> +
> + s.name_length = NODE_LEN (hn);
> + s.flags = hn->flags & NODE_POISONED;
Same as "s.flags = 0;". See do_pragma_poison.
> +
> + if (hn->type == NT_MACRO)
Considering its location, this looks like if (1)
> +static hashval_t
> +hashmem (p_p, sz)
> + const void *p_p;
> + size_t sz;
> +{
> + const unsigned char *p = (const unsigned char *)p_p;
> + size_t i;
> + hashval_t h;
> +
> + h = 0;
> + for (i = 0; i < sz; i++)
> + h = h * 67 - (*p++ - 113);
> + return h;
> +}
I think this is the same as the one in hashtable.c, right? We should
probably just make that non-static, since we'll be linking against
it anyway.
Neil.