Skip site navigation (1) Skip section navigation (2)

Re: Mostly Harmless: c++reserved - patch 1 of 4

From: Kurt Harriman <harriman(at)acm(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Mostly Harmless: c++reserved - patch 1 of 4
Date: 2008-12-05 09:13:37
Message-ID: 4938F0C1.6050309@acm.org (view raw or flat)
Thread:
Lists: pgsql-hackers
(Re-sending just the first of four patches: c++reserved)

These patches are based on CVS head in which the latest commit was
  user:        petere
  date:        Thu Dec 04 17:51:28 2008 +0000
  summary:     Default values for function arguments

1. c++reserved

     User-defined functions and extensions may need to access
     backend data structures such as parse trees.  A few of the
     relevant header files contain field or parameter names
     which happen to be C++ reserved words.  This makes them
     unusable from C++ because the compiler chokes on the
     reserved word.  It has been suggested that the C++ user
     could surround these #includes with #defines to substitute
     innocuous words for the reserved words; but that would be
     unbearably kludgy, error prone and unmaintainable.  A polite
     host does not demand such things of a guest.

     Fortunately, there are not many instances which are likely
     to be encountered by our C++ guests, and these can easily
     be changed.  In memnodes.h, parsenodes.h, and primnodes.h,
     this patch changes the following field names:

         typename => typeName
         typeid => typeOid
         using => usingClause
         delete => delete_context

     Also, the patch changes a few parameter names in function
     prototypes in makefuncs.h, parse_type.h, and builtins.h:

                 typename => typeName
         typeid => typeOid
         namespace => qualifier

     There's no need to ask PostgreSQL developers to remember to
         avoid C++ reserved words, because C++ users who are affected
     by such occurrences can be asked to submit a corrective patch.


Attachment: c++reserved.patch
Description: text/plain (47.4 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Kurt HarrimanDate: 2008-12-05 09:16:37
Subject: Re: Mostly Harmless: c++bookends - patch 2 of 4
Previous:From: Greg SmithDate: 2008-12-05 09:12:00
Subject: Re: Mostly Harmless: Welcoming our C++ friends

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group