Issue 124361 - Eliminate some warnings in sc/
Summary: Eliminate some warnings in sc/
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: 4.1.0-dev
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-05 10:35 UTC by Andre
Modified: 2017-05-20 10:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andre 2014-03-05 10:35:58 UTC
Compiling module sc/ produces a lot of annoying warnings, some in system header files (on Windows), some in sc/ files.
Comment 1 Andre 2014-03-05 10:47:43 UTC
One of the warnings is C4555.  First lines look like this:

 warning C4555: expression has no effect; expected expression with side-effect
C:\PROGRA~2\MICROS~1.0\VC\include\../../VC/include/list(1126) : while compiling class template member function 'void 

This seems to be triggered by the hash_map wrapper in stlport/.  The positive aspect is that this allows us to temporarily turn off this particular warning.
Comment 2 SVN Robot 2014-03-05 10:51:54 UTC
"af" committed SVN revision 1574415 into trunk:
124361: Avoid MSVC warning 4555 while including unordered_map.
Comment 3 Andre 2014-03-05 10:55:18 UTC
Using

    #pragma warning(push)
    #pragma warning(disable:4555)
    #include ...
    #pragma warning(pop)

to temporarly disable warning 4555.  Windows only.
Comment 4 Andre 2014-03-05 11:57:51 UTC
Another warning that is both annoying and easy to fix is triggered in ScSingleRefData::InitMembers().  Because it is an inline method the warning is triggered every time the refdata.hxx header is included, which is quite often.

It uses multiple assignments in one statement:
    nCol = nRow = nTab = nRelCol = nRelRow = nRelTab = 0;
The warning is triggered because the variables are not ordered properly and one of the SCROW (defined as sal_Int32) is assigned to one of the SCCOL (defined as sal_Int16) objects.

To avoid the warning and improve readability I turned the statement into three, one for each type.

Better yet would probably be to do the initialization in the (missing) constructor.
Comment 5 SVN Robot 2014-03-05 12:10:32 UTC
"af" committed SVN revision 1574449 into trunk:
124361: Avoid warning by not assigning from sal_Int32 to sal_Int16.
Comment 6 Andre 2014-03-05 13:53:21 UTC
Repeated the fix described in comments 1-3 for stlport/systemstl/list.
Comment 7 SVN Robot 2014-03-05 13:58:19 UTC
"af" committed SVN revision 1574487 into trunk:
124361: Avoid MSVC warning 4555 while including list.
Comment 8 SVN Robot 2014-03-10 12:59:22 UTC
"af" committed SVN revision 1575927 into trunk:
i124361: Removed some warnings from sc.
Comment 9 SVN Robot 2014-03-10 12:59:23 UTC
"af" committed SVN revision 1575930 into trunk:
i124361: Enable exception support for all sc source files.
Comment 10 SVN Robot 2014-03-10 13:01:47 UTC
"af" committed SVN revision 1575931 into trunk:
i124361: Removed unreachable code to avoid warnings.
Comment 11 Andre 2014-03-10 13:04:28 UTC
Revision 1575927 and revision 1575931 are some minor changes that remove a bunch of warnings, mostly unreachable code and possible data loss when converting data types.

Revision 1575930 enables exception support for all source files of sc.
Comment 12 SVN Robot 2014-03-10 14:20:02 UTC
"af" committed SVN revision 1575948 into trunk:
i124361: Removed empty and unused makefiles.
Comment 13 Marcus 2017-05-20 10:44:28 UTC
Reset the assignee to the default "issues@openoffice.apache.org".