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

error: initializer element is not a compile-time constant in sound/pci/hda/cirrus_scodec_test.c #1935

Closed
nickdesaulniers opened this issue Sep 19, 2023 · 4 comments
Labels
[BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list.

Comments

@nickdesaulniers
Copy link
Member

reported: https://lore.kernel.org/all/ZQoILN6QCjzosCOs@google.com/

sound/pci/hda/cirrus_scodec_test.c:151:60: error: initializer element is not a compile-time constant
  151 |                 SOFTWARE_NODE_REFERENCE(&cirrus_scodec_test_gpio_swnode, gpio_num, 0);
      |                                                                          ^~~~~~~~
/builds/linux/include/linux/property.h:291:37: note: expanded from macro 'SOFTWARE_NODE_REFERENCE'
  291 |         .nargs = ARRAY_SIZE(((u64[]){ 0, ##__VA_ARGS__ })) - 1, \
      |                                            ^~~~~~~~~~~
/builds/linux/include/linux/kernel.h:57:75: note: expanded from macro 'ARRAY_SIZE'
   57 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
      |                                                                           ^~~
/builds/linux/include/linux/compiler.h:228:59: note: expanded from macro '__must_be_array'
  228 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
      |                                                                ^
/builds/linux/include/linux/compiler_types.h:366:63: note: expanded from macro '__same_type'
  366 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
      |                                                               ^
/builds/linux/include/linux/build_bug.h:16:62: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
      |                                                              ^

gpio_num is a loop induction variable that's being incremented and decremented in the caller.

ci: https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/6235508429/job/16929304156#step:6:1853

@nickdesaulniers nickdesaulniers added [BUG] linux-next This is an issue only seen in linux-next Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. labels Sep 19, 2023
@nickdesaulniers
Copy link
Member Author

smells like #1889, but this instance is observed in CI with clang-18, which contains fixes in llvm for that issue.

@nickdesaulniers
Copy link
Member Author

@nickdesaulniers nickdesaulniers added the [PATCH] Submitted A patch has been submitted for review label Sep 20, 2023
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Oct 5, 2023
Replace custom and non-portable implementation of COUNT_ARGS().

Fixes: e64b674 ("software node: implement reference properties")
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Closes: https://lore.kernel.org/r/ZQoILN6QCjzosCOs@google.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Closes: ClangBuiltLinux#1935
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20230920153819.2069869-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@nathanchance
Copy link
Member

@nickdesaulniers nickdesaulniers added [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Submitted A patch has been submitted for review labels Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list.
Projects
None yet
Development

No branches or pull requests

2 participants