Re: Memo on coding practices: strcmp() does not yield bool - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Memo on coding practices: strcmp() does not yield bool
Date
Msg-id 8121.962936212@sss.pgh.pa.us
Whole thread Raw
In response to Re: Memo on coding practices: strcmp() does not yield bool  (JanWieck@t-online.de (Jan Wieck))
List pgsql-hackers
JanWieck@t-online.de (Jan Wieck) writes:
>     Oh  boy.  Originally  I  wrote  ruleutils.c  as  a proof that
>     rewrite rules "can" tell what the  original  rule  (or  view)
>     looked  like.  Someone  called it a "magic piece of software"
>     and we adopted it as a useful thing to dump views  and  rules
>     (what  we  wheren't  able before).  Now you blame me for it's
>     uglyness.

Hey, I didn't mean to sound like I was picking on you in particular.
There are a lot of instances of that coding practice in our system.

I just used ruleutils.c as an example because that was where the
reported bug was --- and yes, this was from a regression test porting
failure report; the rules output was missing some AS clauses it
should've had.  With this fix, we pass regress tests on MkLinux PPC 
at default optimization level.  This bug was probably masked before
because we couldn't compile with optimization on that platform,
due to the far worse portability bugs in fmgr.

The way I see it, today we learned one more tidbit about how to produce
portable C code.  You didn't know it before, and neither did I.  No
shame in that.

The more bugs we fix, the higher our standards become.  It's all
part of the process of world domination ;-)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 2nd update on TOAST
Next
From: Tom Lane
Date:
Subject: fcntl(SETLK) [was Re: 2nd update on TOAST]