Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncrustify fails in multiline macro and respond without corresponding #if in .h file. #4272

Open
ashvnparmar opened this issue Apr 10, 2024 · 0 comments

Comments

@ashvnparmar
Copy link

I have issue with uncrustify validation of C header file. I have attached file along with configuration file. Please find below detailed information,

  1. Uncrustify version
ashvnp@AX3:~/uncrustify/build:$(origin):((HEAD detached at uncrustify-0.78.1))$ uncrustify -v
Uncrustify-0.78.1
  1. Output file error logs on console (Not generating unc_debug.txt file)
ashvnp@AX3:$ uncrustify  -p unc_debug.txt -c unc_update.cfg --check -f all_tests.h

do_source_file: Parsing: all_tests.h as language C-Header
parse_cleanup(469): pc orig line is 19, orig col is 1, Text() is '}', type is BRACE_CLOSE
check(271): #endif found, at line 22, column 1, without corresponding #if
  1. Checked with Uncrustify list of versions
Uncrustify-0.78.0
Uncrustify-0.78.1
Uncrustify-0.78.1-159-42070cb65

In file all_tests.h if I make line:14 to line:16 in one line (line:14) then it works fine (Please find attached updated file with name all_tests_pass.h). But that is also with limitations like I can't run uncrustify on it next time as it returns with same issue. Attached file unc_debug.txt is output of all_tests_pass.h file check.

ashvnp@AX3:~::$ uncrustify  -p unc_debug.txt -c unc_update.cfg --no-backup -f all_tests_pass.h
do_source_file: Parsing: all_tests_pass.h as language C-Header
#ifndef ALL_TESTS_H_
#define ALL_TESTS_H_

#include <stdio.h>
#include <string.h>
#include "debug.h"

static void add_all_tests (unsigned int rcv_cmd)
{
        test_command_all (rcv_cmd);
    debug_print ("rcv command information is being received and processed further \
                  with is %d", rcv_cmd);

#if (defined TESTING_RUN_ABCD || defined TESTING_RUN_EFGH || defined TESTING_RUN_IJKL) &&\
        !defined TESTING_SKIP_WXYZ
        ENABLE_TESTING (add_test);
#endif
}


#endif  /* ALL_TESTS_H_ */

Does it require to do any other configuration in uncrustify config file?

Could anyone please help me to resolve this issue?

[Note: Some files are renamed with .txt extensions]
unc_debug.txt
all_tests.h.txt
all_tests_pass.h.txt
unc_update.cfg.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants