Commit Graph
26 Commits
Author SHA1 Message Date
Noel Grandin c42cf09f17 Revert "loplugin:constfields in tools"
This reverts commit 833c4965fc.

Change-Id: I130a91538627f9e83d94615e2ddd48da5a075d4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90517
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-15 16:28:03 +01:00
Noel Grandin 1a53e60d44 sal_Char->char in tools
Change-Id: Id8be02e445ac439439b2f78ba4a7376dd19ce360
Reviewed-on: https://gerrit.libreoffice.org/85744
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-23 15:12:29 +01:00
Stephan Bergmann f853ec317f Extend loplugin:external to warn about classes
...following up on 314f15bff0 "Extend
loplugin:external to warn about enums".

Cases where free functions were moved into an unnamed namespace along with a
class, to not break ADL, are in:

  filter/source/svg/svgexport.cxx
  sc/source/filter/excel/xelink.cxx
  sc/source/filter/excel/xilink.cxx
  svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx

All other free functions mentioning moved classes appear to be harmless and not
give rise to (silent, even) ADL breakage.  (One remaining TODO in
compilerplugins/clang/external.cxx is that derived classes are not covered by
computeAffectedTypes, even though they could also be affected by ADL-breakage---
but don't seem to be in any acutal case across the code base.)

For friend declarations using elaborate type specifiers, like

  class C1 {};
  class C2 { friend class C1; };

* If C2 (but not C1) is moved into an unnamed namespace, the friend declaration
must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see
C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither
qualified nor a template-id and the declaration is a function or an
elaborated-type-specifier, the lookup to determine whether the entity has been
previously declared shall not consider any scopes outside the innermost
enclosing namespace.")

* If C1 (but not C2) is moved into an unnamed namespace, the friend declaration
must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882>
"elaborated-type-specifier friend not looked up in unnamed namespace".

Apart from that, to keep changes simple and mostly mechanical (which should help
avoid regressions), out-of-line definitions of class members have been left in
the enclosing (named) namespace.  But explicit specializations of class
templates had to be moved into the unnamed namespace to appease
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of
template from unnamed namespace using unqualified-id in enclosing namespace".

Also, accompanying declarations (of e.g. typedefs or static variables) that
could arguably be moved into the unnamed namespace too have been left alone.

And in some cases, mention of affected types in blacklists in other loplugins
needed to be adapted.

And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which
is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is
not moved into an unnamed namespace (because it is declared in
sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is.  GCC warns about
such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler
doesn’t give this warning for types defined in the main .C file, as those are
unlikely to have multiple definitions."
(<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>)  The
warned-about classes also don't have multiple definitions in the given test, so
disable the warning when including the .cxx.

Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4
Reviewed-on: https://gerrit.libreoffice.org/83239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-22 12:57:32 +01:00
Noel Grandin 833c4965fc loplugin:constfields in tools
Change-Id: I83499cfb49f7abdbf0629c60167d09a1352571ee
Reviewed-on: https://gerrit.libreoffice.org/60987
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27 08:29:49 +02:00
Jochen Nitschke 01b4c5b27f cppcheck: useInitializationList in test to xmloff
Change-Id: I50545784c5412ab7767f401c6e40058a1d0bfab0
Reviewed-on: https://gerrit.libreoffice.org/58262
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-29 08:52:51 +02:00
Noel Grandin 9ffdf7adc0 loplugin:unusedfields in tools..xmlhelp
Change-Id: I5e909a8def86ce9ad150440e6c6ad304e855cc69
Reviewed-on: https://gerrit.libreoffice.org/54415
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-17 08:39:51 +02:00
Stephan Bergmann 0b14c0fbef Remove stdlib.h from sal/config.h
This reverts 5da3337c00 "readded include stdlib.h,
because of missing NULL definition in many headers, #100000, #101685", which is
no longer relevant.

Change-Id: I544ed9a7afbf7b611bc481b8d50acca3193d93de
Reviewed-on: https://gerrit.libreoffice.org/48131
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-25 23:23:03 +01:00
Stephan Bergmann 1c4f33b5d8 loplugin:nullptr (automatic rewrite)
Change-Id: Ia5acfb564f913d52cd25b5d64d06b5280b94cb72
2015-11-10 10:31:54 +01:00
Thomas Arnhold d3041640a0 tools: just generate the complete reversemap.cxx
This makes tools pch ready.

Change-Id: I8d5d5fcbb417f3790749aeb9d9c947f739ecb30f
2014-05-22 12:50:45 +02:00
Thomas Arnhold 8449225508 fix-includes.pl: tools
Change-Id: I66b3dc79998de018eae1c7eff8ce23f95e3c3f33
2014-05-22 12:50:45 +02:00
Michael Meeks 03993b47c5 targetted clean of redundant header piece from 62badf3828
Change-Id: Ic1240114d667fb7797afae4847427cc889f3cb48
2013-07-26 14:18:52 +01:00
Michael Meeks 62badf3828 Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-22 09:37:38 +01:00
Philipp Riemer 42352dff5a removed ascii-art and blank lines in tools/source
Change-Id: I3f95d12a8c325c96c586253b5d9bb7dce24c0858
2012-08-18 18:33:50 +02:00
Matúš Kukan 4b30d8addc tools: use CustomTarget makefile 2012-03-31 22:49:31 +02:00
Stephan Bergmann 4eba18ae5f Code clean up. 2012-01-20 12:14:46 +01:00
Bjoern Michaelsen 3f7e6fe611 use gbuild_simple in tools 2011-12-07 15:53:03 +01:00
Tor Lillqvist 832d65122a Require bestreversemap executable for the build platform 2011-06-12 13:22:38 +03:00
Bjoern Michaelsen e1028d9225 remove unused variable warning 2011-03-17 15:30:36 +01:00
Michael Meeks ce0c58c96b fix bestreversemap generation, fully this time 2011-03-17 13:54:24 +00:00
Michael Meeks 2841a73379 get paths right when building reversemap 2011-03-17 13:28:18 +00:00
Tor Lillqvist 7851d63547 Just use a normal main(), no need for SAL crack here 2011-03-16 21:32:01 +02:00
Bjoern Michaelsen 33ee45ab0d using CustomTarget for generated code 2011-03-16 19:04:46 +01:00
Caolán McNamara 3e2a450a92 WaE: gcc 4.6.0 various warnings 2011-01-24 10:46:04 +00:00
Caolán McNamara 22ba0d9150 flush stdout before returning from main in case _exit hack is operational 2011-01-06 22:12:57 +00:00
Caolán McNamara 95a0a2a62c C1061: workaround worthless compiler 2010-12-16 20:18:26 +00:00
Caolán McNamara b52f6cc76d Resolves: #i101057#/#i97332# A better converter to multiple legacy codepages 2010-12-15 08:51:34 +00:00