switching to C++ compiling by -xc++ (was: gnucash master: Multiple changes pushed)

Christian Stimming christian at cstimming.de
Sun Apr 27 16:06:24 EDT 2014


Hi John,

in bedf00a160669a86942a1b52f47c65b8c45c9552 you said you changed "LibQOF to be 
compiled as C++", which you did by adding "-xc++"  to the CFLAGS, but leaving 
the file suffixes as ".c".

This isn't nice. The convention throughout all projects that I know so far is 
that if the file ends in .c, it's a C file that gets compiled as C code, 
whereas if the file name ends in .cpp or .cc or whatever else is the preferred 
convention, it's a C++ file that gets compiled as C++. This is also what the 
CMake tools expect and use as heuristic for choosing to appropriate compiler, 
let alone any other build system out there.

If we want to switch all files from C to C++, can we please please also change 
the file name suffix accordingly? If we don't want to switch the files to C++, 
then just leave the name as is but also stick to compiling this as C. I 
consider the magic -xc++ switch by gcc to be some very unexpected workaround 
to trick a .c file into something else.

Can we please trigger the switch from C to C++ by renaming the files, one by 
one? This makes it clear which files have to adhere to C++ rules and which 
ones don't have to. Thanks!

Regards,

Christian

Am Freitag, 25. April 2014, 16:42:42 schrieb John Ralls:
> Updated	 via  https://github.com/Gnucash/gnucash/commit/daf44808 (commit)
> 	 via  https://github.com/Gnucash/gnucash/commit/bedf00a1 (commit)
> 	 via  https://github.com/Gnucash/gnucash/commit/3abf8b47 (commit)
> 	from  https://github.com/Gnucash/gnucash/commit/e6c36983 (commit)
> 
> 
> 
> 
> 
> Summary of changes:
>  po/POTFILES.in                                    |   3 +-
>  src/backend/dbi/gnc-backend-dbi.c                 |   4 -
>  src/backend/xml/gnc-backend-xml.c                 |   2 -
>  src/backend/xml/sixtp-dom-generators.c            |   3 +-
>  src/engine/engine-helpers.c                       |   3 +-
>  src/engine/kvp-scm.c                              |   4 +-
>  src/engine/test/Makefile.am                       |   4 +-
>  src/engine/test/utest-Split.c                     |  36 ++--
>  src/libqof/qof/Makefile.am                        |  16 +-
>  src/libqof/qof/gnc-date.c                         |  44 +++--
>  src/libqof/qof/gnc-date.h                         |  10 +-
>  src/libqof/qof/{gnc-numeric.c => gnc-numeric.cpp} |  11 +-
>  src/libqof/qof/gnc-numeric.h                      |   8 +
>  src/libqof/qof/guid.c                             |  18 +-
>  src/libqof/qof/guid.h                             |   9 +
>  src/libqof/qof/kvp-util-p.h                       |   9 +
>  src/libqof/qof/kvp-util.c                         |  15 +-
>  src/libqof/qof/kvp-util.h                         |   9 +
>  src/libqof/qof/kvp_frame.c                        |  44 +++--
>  src/libqof/qof/kvp_frame.h                        |  10 ++
>  src/libqof/qof/qof-string-cache.c                 |  13 +-
>  src/libqof/qof/qof-string-cache.h                 |   9 +
>  src/libqof/qof/qof-win32.c                        |   9 +
>  src/libqof/qof/qof.h                              |   1 -
>  src/libqof/qof/qofbackend-p.h                     |  17 +-
>  src/libqof/qof/qofbackend.c                       |  12 +-
>  src/libqof/qof/qofbackend.h                       |   8 +
>  src/libqof/qof/qofbook-p.h                        |   9 +
>  src/libqof/qof/qofbook.c                          |  30 ++--
>  src/libqof/qof/qofbook.h                          |  11 +-
>  src/libqof/qof/qofchoice.c                        |  18 +-
>  src/libqof/qof/qofchoice.h                        |   9 +
>  src/libqof/qof/qofclass.c                         |  33 ++--
>  src/libqof/qof/qofclass.h                         |   9 +
>  src/libqof/qof/qofevent.c                         |  18 +-
>  src/libqof/qof/qofevent.h                         |   9 +
>  src/libqof/qof/qofid-p.h                          |   9 +
>  src/libqof/qof/qofid.c                            |  18 +-
>  src/libqof/qof/qofid.h                            |   9 +
>  src/libqof/qof/qofinstance-p.h                    |   9 +
>  src/libqof/qof/qofinstance.c                      |  26 ++-
>  src/libqof/qof/qoflog.c                           |  18 +-
>  src/libqof/qof/qoflog.h                           |  13 +-
>  src/libqof/qof/qofobject-p.h                      |   9 +
>  src/libqof/qof/qofobject.c                        |  48 ++++--
>  src/libqof/qof/qofobject.h                        |   9 +
>  src/libqof/qof/qofquery-p.h                       |   9 +
>  src/libqof/qof/qofquery.c                         | 190
> +++++++++++--------- src/libqof/qof/qofquery.h                         |  
> 9 +
>  src/libqof/qof/qofquerycore.c                     |  79 +++++----
>  src/libqof/qof/qofquerycore.h                     |   9 +
>  src/libqof/qof/qofreference.c                     | 179 -------------------
> src/libqof/qof/qofreference.h                     | 200
> ---------------------- src/libqof/qof/qofsession-p.h                     | 
>  9 +
>  src/libqof/qof/qofsession.c                       | 124 +++-----------
>  src/libqof/qof/qofsession.h                       |   9 +
>  src/libqof/qof/qofutil.h                          |   9 +
>  src/libqof/qof/test/test-gnc-date.c               |  20 ++-
>  src/libqof/qof/test/test-kvp_frame.c              |  10 ++
>  src/libqof/qof/test/test-qofbook.c                |  15 +-
>  src/libqof/qof/test/test-qofobject.c              |  18 ++
>  src/libqof/qof/test/test-qofsession.c             |  69 +++-----
>  62 files changed, 813 insertions(+), 790 deletions(-)
>  rename src/libqof/qof/{gnc-numeric.c => gnc-numeric.cpp} (99%)
>  delete mode 100644 src/libqof/qof/qofreference.c
>  delete mode 100644 src/libqof/qof/qofreference.h
> 
> _______________________________________________
> gnucash-patches mailing list
> gnucash-patches at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-patches



More information about the gnucash-devel mailing list