nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

[BUG] NXStyle is not getting braces declaration violation

Open acassis opened this issue 8 months ago • 5 comments

Description / Steps to reproduce the issue

Image

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

all

NuttX Version

mainline

Issue Architecture

[Arch: all]

Issue Area

[Area: Other]

Host information

nxstyle needs to be fixed to catch this issue

Verification

  • [x] I have verified before submitting the report.

acassis avatar Apr 22 '25 12:04 acassis

What does a git bisect find?

TimJTi avatar Apr 22 '25 20:04 TimJTi

@TimJTi it is something that never was suppose to work

acassis avatar Apr 22 '25 20:04 acassis

Not sure I follow then - when I use checkpatch.sh it always reports Left bracket not on separate line for the violation in your snippet. Perhaps you need to be more specific here?

TimJTi avatar Apr 22 '25 20:04 TimJTi

@TimJTi maybe we can do a test submitting a PR with same code to double check. Maybe nxstyle in our machine catch it, but in the CI ignoring it.

acassis avatar Apr 23 '25 00:04 acassis

it works for global variables but it doesn't work for function local variables:

/****************************************************************************
 * Private Data
 ****************************************************************************/


const uint8_t g_xxx[] = {    ///////////// detected correctly
  0x00
};

/****************************************************************************
 * Public Functions
 ****************************************************************************/

void foo(void)
{
  int i;

  const uint8_t xxx[] = {   //////////////////// not detected
    0x00, 0x00, 0x00, 0x00
  };

  return;
}


raiden00pl avatar Apr 23 '25 07:04 raiden00pl