Dear Jeff,
        Thank you very much for your remarks. I would like to share what I
think.

2.a
Of course we are talking about C files and not C++ files, so any compiler
will accept the sources as they are (at least till now). But the point here
I believe is making the codebase easy to read and maintain. Nowadays
programmers (unlike  us I am afraid - I am 52 years old) are used to C++
more than C; so trying to use the common subset between ISO C e C++ standard
make sense. If I take gcc and I compile the code with the option
"-Wc++-compat" I get a warning for every ISO C construct that is outside of
the common subset of ISO C and ISO C++, e.g. request for implicit conversion
from void * to a pointer to non-void type.
So that is an effort in making the code easily readable by programmers (not
compilers) with C++ background.

2.b
Shocking? Have a look at the file "tclXkeylist.c"... The same construct is
used  here and there in other places (look at the diffs).

2.c
Well the new STD 201X defines as keyword (see section 6.4.1) "_Bool", but
there's a macro definition converting "bool" to "_Bool" . For "new" and
"delete" the point is once again avoiding mismatches between C and C++,
causing confusion to a reader/programmer/maintainer with a C++ mindset.

Summing up:
1. I have done a static code analysis of all the codebase.
2. I have identified these discrepancies and corrected all of them
3. This makes the overall system easier to read and to maintain

BTW: 90% of my current business (bread and butter) comes from doing this
type of analysis on various systems. Most of the time it is for embedded
systems used in avionics applications. There the language is mostly Ada and
not C or C++.

Hope it clarifies my point,
Maurizio


-----Original Message-----
From: Jeff Rogers [mailto:dv...@diphi.com] 
Sent: 16 October 2012 01:38
To: Maurizio Martignano
Cc: aolserver-talk@lists.sourceforge.net
Subject: Re: [AOLSERVER] Naviserver Win-64 Sources

Maurizio Martignano wrote:

> 2.A set of necessary cosmetics/make up changes to the overall code 
> base to make it more compliant with nowadays C STDs, and therefore 
> more "acceptable" to nowadays C compilers, they are:
>
> a.I have made explicit all type conversions (with explicit casts)
>
> b.I have modified all functions defined in K&R C STD, changing them
>   into ANSI C STD
>
> c.I have removed from the code base all reserved words, e.g.: new, 
> delete, bool .

Are you building with a C compiler or a c++ compiler?  new, delete, and bool
are not reserved words in any dialect of C that I'm aware of.
C++ is also pickier about casting; in C you should be able to cast any
pointer to or from a void* without a cast.

The K&R definitions can go; It's somewhat shocking there would be any 
still around.

-J


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
aolserver-talk mailing list
aolserver-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/aolserver-talk

Reply via email to