[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: PCB Patches: Use c99 bool instead of manual typedef.
Robert Spanton wrote:
Advantages:
* Compiler is able to perform optimisations specific to the bool
type.
Yes, it is. I don't think the gain will be noticeable, though.
PCB data are mostly ints, and pointers, and floats, and doubles.
* Additional type safety.
I think I don't see. gcc -Wall processes
"bool a,b,c; a=0x11; b=1; c=a-b;" silently.
* Code becomes less obfuscated (in my mind it's similar to
typedef'ing an int to be Int) and so more approachable by new
hackers.
To my mind, it depends on the person: "bool" is a macro,
and the standard states that it may be redefined by the program.
"Boolean" is typically a typedef, and typedefs are not redefineable
(not in the same compilation unit).
* Crucially for me, any code in PCB used outside PCB's source
doesn't have to have this additional "Boolean" type cluttering
the place up.
Will "Boolean" conflict with your sources? are not you going
to use other PCB types?
On closer inspection, the build scripts in PCB don't specifically
require C99. I was looking at the arguments it was feeding to the
compiler. What I said earlier in this thread about adding
AC_HEADER_STDBOOL still applies.
Your patches don't implement it.
(Also note that C99 introduced the ubiquitous '//' inline comment into
the C standard.)
True. oh, please don't replace all C-style comments
with C++-style ones in PCB! it will be a real pain for some people
on the list to rebase their local patch sets against new
master HEAD.
Cheers,
Ineiev
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user