This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PCH] cpp & dependencies


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]