ad9498f8b8
More -Werror,-Wunused-private-field
...
...detected with a modified trunk Clang with
> Index: lib/Sema/SemaDeclCXX.cpp
> ===================================================================
> --- lib/Sema/SemaDeclCXX.cpp (revision 219190)
> +++ lib/Sema/SemaDeclCXX.cpp (working copy)
> @@ -1917,9 +1917,10 @@
> const Type *T = FD.getType()->getBaseElementTypeUnsafe();
> // FIXME: Destruction of ObjC lifetime types has side-effects.
> if (const CXXRecordDecl *RD = T->getAsCXXRecordDecl())
> - return !RD->isCompleteDefinition() ||
> - !RD->hasTrivialDefaultConstructor() ||
> - !RD->hasTrivialDestructor();
> + return !RD->hasAttr<WarnUnusedAttr>() &&
> + (!RD->isCompleteDefinition() ||
> + !RD->hasTrivialDefaultConstructor() ||
> + !RD->hasTrivialDestructor());
> return false;
> }
>
> @@ -3517,9 +3518,11 @@
> bool addFieldInitializer(CXXCtorInitializer *Init) {
> AllToInit.push_back(Init);
>
> +#if 0
> // Check whether this initializer makes the field "used".
> if (Init->getInit()->HasSideEffects(S.Context))
> S.UnusedPrivateFields.remove(Init->getAnyMember());
> +#endif
>
> return false;
> }
to warn about members of SAL_WARN_UNUSED-annotated class types, and warn about
initializations with side effects (cf.
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039602.html >
"-Wunused-private-field distracted by side effects").
Change-Id: I3f3181c4eb8180ca28e1fa3dffc9dbe1002c6628
2014-10-15 15:58:56 +02:00
dccc707da6
Revert "This was OString already; use it that way"
...
This reverts commit 9a25d12534f91c13400a63e265fb5aa14c6aca66,
there's another use of DebugAttributes.find(rAttrName) in that
function where rAttrName is of type OUString.
2014-10-10 14:11:03 +02:00
9a25d12534
This was OString already; use it that way
...
Change-Id: Ia2268ce8a1e2111adb609c515e5bfa824afa66ce
2014-10-10 13:50:03 +02:00
f1694b3f18
coverity#1158274 Uncaught exception
...
Change-Id: Icfbe30efa3ebd63620a900e345e4b4a74070b021
2014-10-02 14:49:11 +01:00
fd8682cc34
fix indent
...
Change-Id: Ife7b28fcb67051c41831ef9eb566c3a2c148033d
2014-10-02 14:49:11 +01:00
5717312686
consistent capitalization in both exceptions
...
Change-Id: I495a92c24847de265f04abb3670532270b5d6034
2014-10-02 14:49:10 +01:00
2d1253af62
coverity#1242946 Unused value
...
Change-Id: I5a5f0e96f8dc7443901ea7de568a21924137e139
2014-10-02 14:48:48 +01:00
b697e5a8fe
Unused FastSaxSerializer::maSavedMarkStack member
...
Change-Id: Ib665b3870f3d4b00c70d3f928452639464adca69
2014-09-24 15:35:20 +02:00
d7350545ac
Better to throw than crash, if token handler is not set.
...
Change-Id: If6b2d39b487b5f673d5b6b2945a6e7d08777594e
2014-09-18 15:34:26 +02:00
59f1e330f0
Use plain bool parameter here
...
Change-Id: Ic948889a0fac32adc48a7a4fb1e7f82ce8b08ba4
2014-08-30 09:20:44 +02:00
f740673ed7
Avoid incomplete type in fn sig to keep ubsan's RTTI-based checks happy
...
Change-Id: I2d4e4be562cc752e7545792b148d5ed0cf551f25
2014-08-07 18:35:59 +02:00
9af1cbf233
fdo#81214 - tolerate exceptions thrown inside XFastParser callbacks.
...
Not an ideal solution; ideally we should not throw the exceptions,
and stop the parser as soon as something bad like this happens; but
hopefully exception throwing is reasonable exceptional.
Change-Id: If619592533b2929c671e2b03eb8a83480bd92c54
2014-07-11 20:51:18 +01:00
0f6888a25b
FastSaxSerializer: update documentation
...
Change-Id: I5e374c426a4741a88d43848392fc83e2368dbf92
2014-07-03 15:47:29 +02:00
83d51e5e52
fdo#80748: Fix for file corruption due to framePr
...
-For framePr Unit test is there in ooxmlexport.cxx
-http://opengrok.libreoffice.org/xref/core/sw/qa/extras/ooxmlexport/ooxmlexport.cxx#3578
Change-Id: Ic1fd4c7a863d8ab57c6495e20bff6863eb941688
Reviewed-on: https://gerrit.libreoffice.org/10045
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk >
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk >
2014-07-03 13:36:26 +00:00
dc93074f71
Use a new fast parser instance for each XML fragment.
...
Otherwise a crash ensues when the threaded XML parsing kicks in.
Change-Id: Ic41e5a29bbb860d7b63b70f2f0d8896264d9d53e
2014-06-30 20:06:33 -04:00
3f177756db
Check for empty() before calling top().
...
Else it might crash sometimes.
Change-Id: I6a24fff83c3d36346debae5c0f2b8c0646a15c01
2014-06-30 14:02:50 -04:00
3ede68e1cc
Don't go further and pop the stack if it's empty.
...
Change-Id: I27bd30ca65cf0066cd022b4b060757913ea01fed
2014-06-30 13:46:36 -04:00
ee6ffa3f15
loplugin:staticcall
...
Change-Id: If21a079134f659a91f0b0ce400aef56bd095effe
2014-06-13 17:54:30 +02:00
ebc0a15515
remove more unnecesary OUString constructor use
...
when throwing exceptions
Change-Id: I6edfb6b6745499f802b0e3c0e096a36fb7c32aac
2014-05-29 09:01:40 +02:00
92b447876d
css already means ::com::sun::star
...
Change-Id: I48d7b746d7cc49246743c62480b0d225d2519342
2014-05-27 14:00:28 +02:00
5b2aaefb89
coverity#982640 Missing break in switch
...
Change-Id: If2a14edafb72844061dcdd1ee3507d7a215220f1
2014-05-26 10:18:27 +01:00
2bd7767d01
Resolves fdo#70681: fixincludeguards.pl: all that's left
...
Change-Id: I3e51a62710bb46c8255fd228d41d9300c90a1fb5
Reviewed-on: https://gerrit.libreoffice.org/9360
Reviewed-by: Thomas Arnhold <thomas@arnhold.org >
Tested-by: Thomas Arnhold <thomas@arnhold.org >
2014-05-15 12:50:46 +00:00
248145f99e
Find places where uno::Sequence is passed by value.
...
Implement a clang plugin to find them, and clean up existing code
to pass them by reference.
Change-Id: If642d87407c73346d9c0164b9fc77c5c3c4354b8
Reviewed-on: https://gerrit.libreoffice.org/9351
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-05-14 08:10:22 +00:00
11dbe5eede
coverity#707979 Uninitialized pointer field
...
Change-Id: Id41ba6ab2c6f0a43f439c2b45d20d7d76a3cbe82
2014-05-10 21:13:01 +01:00
1ec8367608
Avoid possible memory leaks in case of exceptions
...
Change-Id: I047fd88a89900153089a55b6af123f11fb8bde55
2014-04-24 00:13:28 +09:00
2805ac13dc
typo: choosen -> chosen
2014-04-14 12:32:02 +02:00
a39ced415f
Remove unused functions
...
Change-Id: Iddf4e29005aaa510af00c7345487996b75f41c41
2014-04-09 11:12:41 +02:00
6ed14fd8f8
sax: sal_Bool->bool
...
Change-Id: I8d9dd585c509fd4c1f09ee817d828f3e600e31d5
2014-04-07 13:53:49 +02:00
362d4f0cd4
Explicitly mark overriding destructors as "virtual"
...
It appears that the C++ standard allows overriding destructors to be marked
"override," but at least some MSVC versions complain about it, so at least make
sure such destructors are explicitly marked "virtual."
Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-04-01 19:22:54 +02:00
70cc2b191b
First batch of adding SAL_OVERRRIDE to overriding function declarations
...
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.
Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
86a32589e9
Find places where OUString and OString are passed by value.
...
It's not very efficient, because we generally end up copying it twice -
once into the parameter and again into the destination OUString.
So I create a clang plugin that finds such places and generates a
warning so that we can convert them to pass-by-reference.
Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361
2014-03-18 08:32:26 +02:00
693f1dee0b
sax: FastAttributeList - add attribute in a specific namespace
...
This change is inspired by startElementNS & singleElementNS which
have namespace as first parameter to define the namespace of an
element. Some attributes of a element can be in different namespace
but until now FastAttributeList "add" method did not have a namespace
parameter. This commit adds "addNS" which accepts namespace as a
first parameter.
Change-Id: Iebf8b5e890c17f00a56923efc3506580eed070a9
2014-03-05 20:24:01 +01:00
54ebae0eae
remove whitespaces
...
Change-Id: I624ca41c3e51ba785e359649c429feb61cc9a647
2014-03-02 17:56:14 +01:00
5e21a413c7
cppuhelper: retrofit std::exception into overriding exception specs
...
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
ff0562fa4f
Remove visual noise from sax
...
Change-Id: Ica31580f72b43456c33b2f6abbf2140a79efae1a
Reviewed-on: https://gerrit.libreoffice.org/8299
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
Tested-by: Caolán McNamara <caolanm@redhat.com >
2014-02-26 08:02:52 -06:00
7efa467ef3
remove unused code sax_fastparser::FastSerializerHelper::copyTopMarkPop()
...
Change-Id: If1dd0e99d83f8211c58fa3b5d1ba56a74bc2157f
2014-02-25 15:16:56 +02:00
333fdb95a3
remove unused code sax_fastparser::FastSerializerHelper::copyTopMarkPush()
...
Change-Id: I4569e53f0423783bc5c9ee95b07d0de51b75b466
2014-02-25 15:16:56 +02:00
0ce0c369aa
Remove unneccessary comments
...
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
Tested-by: Caolán McNamara <caolanm@redhat.com >
2014-02-23 03:38:49 +00:00
09f9a79b11
[API CHANGE] fix endCDATA to allow throwing css::xml::sax::SAXException
...
coverity#1158397 Uncaught exception
Change-Id: Iabf0b1f0500cb4218d8cb3aff372777471e8f287
2014-02-21 15:30:26 +00:00
110c193988
Related: #i97873# (coverity#705407) Improper use of negative value
...
a pity the other one wasn't fixed when the first one was fixed
back in 2002 with 0645e6a1a1917fef833358f328b5d56396380698
Change-Id: Ia7ac0f57a6805dc8ff09668198d0530b1cfc31db
2014-02-11 12:11:43 +00:00
414fa67bf2
sax: my suggestion was not as good as i thought...
...
... as indicated by the failing unit test.
Change-Id: I1a8a8b933b10673e71261726dc8887dfe1d3e2ee
2014-02-11 12:52:21 +01:00
785c4f10b8
fdo#72468 avoid out of bounds array access
...
Change-Id: I2bccdf1aaeb290a3cb8f76cd831a419e1776e92f
Reviewed-on: https://gerrit.libreoffice.org/7775
Reviewed-by: Michael Stahl <mstahl@redhat.com >
Tested-by: Michael Stahl <mstahl@redhat.com >
2014-02-11 10:38:53 +00:00
12e0102f39
coverity#1130446 Uncaught exception
...
Change-Id: I9225b4ffd507fa3d666862a55dae349c9a76e91d
2014-02-08 20:52:41 +00:00
f1a09e08f2
Use rtl::Reference
...
Change-Id: Ia14ad80f13bffe4c1d0078da0198a3ae6eae581e
2014-02-07 09:32:07 +01:00
922f44344e
Avoid css::uno using directives (Reference ambiguities)
...
Change-Id: Ia702572bef47738531b526addeecd86e7b39aad2
2014-02-07 09:29:21 +01:00
7106e437bc
1158273 Uncaught exception
...
Change-Id: I3983da2d585762d81446902a710e9a97c6354669
2014-01-25 12:28:07 +00:00
c5135af60f
coverity#1158443 Uninitialized pointer field
...
Change-Id: I1602678c24c1aeec60acee05801e7decc914560f
2014-01-23 16:16:43 +00:00
be090d5a50
coverity#1158444 Uninitialized scalar field
...
Change-Id: I15f6c6288e2a951543702a15e777167f2240899e
2014-01-23 16:14:49 +00:00
d9d28895f7
coverity#1158445 Uninitialized pointer field
...
Change-Id: I14dc2197543bf98763190b5aea3a366e823312b4
2014-01-23 16:11:55 +00:00
db72a45a1b
coverity#1158493 Uninitialized scalar field
...
Change-Id: I26de8ab1fa4a20bc08e800f04716507469430612
2014-01-23 16:02:11 +00:00