error 5960

Post a reply

This question is a means of preventing automated form submissions by spambots.

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is OFF
Smilies are OFF

Topic review

Expand view Topic review: error 5960

Re: error 5960

by Michael Metivier » Thu Apr 22, 2021 12:31 pm

From the PC-Lint Plus manual:

"Messages in the 4xxx and 5xxx range are used by PC-lint Plus to report clang compiler errors."

PC-Lint Plus uses clang under the hood to do things like parse your code, so this messages is actually coming from the underlying clang implementation rather than from PC-Lint Plus directly.

So, either clang's C++ (based on your .cpp file extension) analysis is not allowing VLA's as they are not a part of the standard language, or you're in C99 land, in which case initialization of this form is forbidden by the language standard: "The type of the entity to be initialized shall be an array of unknown size or an object type that is not a variable length array type."

error 5960

by SeeCwriter » Tue Apr 20, 2021 9:00 pm

I am getting error 5960 for the code below, yet there is nothing in the manual about error 5960.

These are the 2-lines of suspect code:

Code: Select all

  int expBufLen = 32;
  unsigned char expBuf[expBufLen] = {0};
This is the error message:

Code: Select all

Misc.cpp  380  error 5960: variable-sized object may not be initialized
  unsigned char expBuf[expBufLen] = {0};
I don't understand why I'm getting this error.
I'm using PC-lint Plus v1.4.1 Beta1. It does the same with v1.4 release.