[gmx-developers] jenkins cppcheck picky?
Mark Abraham
mark.j.abraham at gmail.com
Sun Sep 1 14:15:01 CEST 2013
What does it think about "PACK_X4 == c"?
On Sun, Sep 1, 2013 at 12:44 PM, David van der Spoel
<spoel at xray.bmc.uu.se> wrote:
> On 2013-09-01 10:17, David van der Spoel wrote:
>>
>> On 2013-09-01 01:23, Mark Abraham wrote:
>>>
>>> We could... Jenkins master was using 1.53. I compiled latest cppcheck
>>> 1.61 and installed it in /opt/local, but see
>>> http://jenkins.gromacs.org/job/cppcheck_Gerrit_master/417/cppcheckResult/
>>> from using it. Using 1.61 routinely will need someone to clean those
>>> up. Don't look at me for at least a fortnight :-)
>>
>> I can give it a try.
>> At least those look more like serious problems.
>
>
> On second thoughts, some of those new ones look fishy too...
> E.g.:
>
> Mismatching assignment and comparison, comparison 'c==4' is always false.
> (line 301):
>
> 0294 for (i = 0; i < na; i++)
> 0295 {
> 0296 xnb[j+XX*PACK_X4] = x[a[i]][XX];
> 0297 xnb[j+YY*PACK_X4] = x[a[i]][YY];
> 0298 xnb[j+ZZ*PACK_X4] = x[a[i]][ZZ];
> 0299 j++;
> 0300 c++;
> 0301 if (c == PACK_X4)
> 0302 {
> 0303 j += (DIM-1)*PACK_X4;
> 0304 c = 0;
> 0305 }
> 0306 }
>
>>
>> @Erik:
>> We can not use formatted input because it works the same way in C as in
>> fortran, reading a fixed number of columns.
>>
>>
>>>
>>> Mark
>>>
>>> On Sat, Aug 31, 2013 at 9:33 PM, David van der Spoel
>>> <spoel at xray.bmc.uu.se> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm getting complaints in jenkins from cppcheck, for code like
>>>>
>>>> int d;
>>>> fscanf(fp, "%d", &d);
>>>>
>>>> namely:
>>>>
>>>> scanf without field width limits can crash with huge input data
>>>>
>>>> Apparently this is a check for an old glibc or something:
>>>> http://sourceforge.net/apps/trac/cppcheck/ticket/3946
>>>>
>>>> Can we upgrade cppcheck?
>>>>
>>>> --
>>>> David van der Spoel, Ph.D., Professor of Biology
>>>> Dept. of Cell & Molec. Biol., Uppsala University.
>>>> Box 596, 75124 Uppsala, Sweden. Phone: +46184714205.
>>>> spoel at xray.bmc.uu.se http://folding.bmc.uu.se
>>>> --
>>>> gmx-developers mailing list
>>>> gmx-developers at gromacs.org
>>>> http://lists.gromacs.org/mailman/listinfo/gmx-developers
>>>> Please don't post (un)subscribe requests to the list. Use the www
>>>> interface
>>>> or send it to gmx-developers-request at gromacs.org.
>>
>>
>>
>
>
> --
> David van der Spoel, Ph.D., Professor of Biology
> Dept. of Cell & Molec. Biol., Uppsala University.
> Box 596, 75124 Uppsala, Sweden. Phone: +46184714205.
> spoel at xray.bmc.uu.se http://folding.bmc.uu.se
> --
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the www interface
> or send it to gmx-developers-request at gromacs.org.
More information about the gromacs.org_gmx-developers
mailing list