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

Re: bool: symbol name collision

From: bryanh(at)giraffe-data(dot)com (Bryan Henderson)
To: peter_e(at)gmx(dot)net
Cc: gsstark(at)mit(dot)edu, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-bugs(at)postgresql(dot)org
Subject: Re: bool: symbol name collision
Date: 2010-05-10 16:16:32
Message-ID: 55346.bryanh@giraffe-data.com (view raw or flat)
Thread:
Lists: pgsql-bugs
>>> It's quite annoying and
>>> sad that they added "bool" to c99 since otherwise it would just be a
>>> drop-in replacement with extra functionality and very low risk of
>>> conflicts. Instead they virtually guaranteed conflicts with any large
>>> software over a single define. 
>
>For that reason they put it into a separate header file stdbool.h that
>no one is required to include.

Yes, and they didn't really create any conflicts that didn't already exist.
No one thinking broadly enough would define "bool" because of the high chance
that somebody else did too, because it's such an obvious name.  The same is
true of names such as "int32".

For this reason, before C99, there were few software distributions that
defined "bool", with the chance of a distribution doing so inversely
proportional to how popular the distribution was.

Likewise, programmers who defined "bool" in their own private code were (and I
guess still are) largely the inexperienced ones -- who hadn't yet been bitten
by an interface header file that arrogantly claimed the name "bool."

-- 
Bryan Henderson                                   San Jose, California

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-05-10 17:56:54
Subject: Re: "SET search_path" clause ignored during function creation
Previous:From: Bryan HendersonDate: 2010-05-10 15:55:21
Subject: Re: bool: symbol name collision

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