In my experience, If the header is to be included in a C program then the // style comments are a bad idea - even if a modern C++ aware compiler is compiling the xxx.c code.
So we can adopt to future trends, it is probably a good idea to get rid of the C++ keywords form all legacy C codes C in base, but then again I can't hide my C++ biases.
Jeff
______________________________________________________
Jeffrey O. Hill Email [email protected]
LANL MS H820 Voice 505 665 1831
Los Alamos NM 87545 USA FAX 505 665 5107
Message content: TSPA
> -----Original Message-----
> From: [email protected] [mailto:core-talk-
> [email protected]] On Behalf Of Ralph Lange
> Sent: Wednesday, June 16, 2010 8:40 AM
> To: EPICS Core Talk
> Subject: Using C++ keywords as variable names in C code
>
> Hello everybody,
>
> I found that db_access.c is using the C++ keyword "new" as a variable
> name. While this is of course valid code, it confuses IDEs, syntax
> highlighting editors and such, so I would probably consider it bad
> practice.
> Has anybody considered fixing this issue? Else I would create a branch
> for it and get it done. While I'm at it - any other C++ keywords I
> should rename? Should I enforce straight C comments instead of C++ style
> "//" comments, too? Or are all compilers accepting these nowadays?
>
> Cheers,
> Ralph
- References:
- Using C++ keywords as variable names in C code Ralph Lange
- Navigate by Date:
- Prev:
Using C++ keywords as variable names in C code Ralph Lange
- Next:
[Merge] lp:~ralph-lange/epics-base/fix-cpp-keywords into lp:epics-base Ralph Lange
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Using C++ keywords as variable names in C code Ralph Lange
- Next:
[Merge] lp:~ralph-lange/epics-base/fix-cpp-keywords into lp:epics-base Ralph Lange
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|