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

Compile error no member named 'buf' when building with -DDEBUG=1 #287

Closed
bence98 opened this issue Sep 5, 2024 · 0 comments · Fixed by #288
Closed

Compile error no member named 'buf' when building with -DDEBUG=1 #287

bence98 opened this issue Sep 5, 2024 · 0 comments · Fixed by #288

Comments

@bence98
Copy link

bence98 commented Sep 5, 2024

Compilation fails when -DDEBUG=1 is set:

make[5]: Entering directory '/home/br-user/buildroot/output/build/eudev-3.2.11/src/udev'
  CC       libudev_core_la-udev-rules.lo
udev-rules.c: In functiondump_token’:
udev-rules.c:328:29: warning: implicit declaration of functionstr’ [-Wimplicit-function-declaration]
  328 |         const char *value = str(rules, token->key.value_off);
      |                             ^~~
udev-rules.c:328:29: warning: initialization ofconst char *fromintmakes pointer from integer without a cast [-Wint-conversion]
udev-rules.c:329:34: error: ‘struct udev_ruleshas no member namedbuf329 |         const char *attr = &rules->buf[token->key.attr_off];
      |                                  ^~
In file included from ../../src/shared/macro.h:259,
                 from udev.h:26,
                 from udev-rules.c:33:
udev-rules.c:339:41: error: ‘struct udev_ruleshas no member namedbuf339 |                                   &rules->buf[token->rule.filename_off], token->rule.filename_line,
      |                                         ^~
../../src/shared/log.h:97:70: note: in definition of macrolog_full_errno97 |                 ? log_internal(_l, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \
      |                                                                      ^~~~~~~~~~~
../../src/shared/log.h:104:28: note: in expansion of macrolog_full104 | #define log_debug(...)     log_full(LOG_DEBUG,   __VA_ARGS__)
      |                            ^~~~~~~~
udev-rules.c:338:25: note: in expansion of macrolog_debug338 |                         log_debug("* RULE %s:%u, token: %u, count: %u, label: '%s'",
      |                         ^~~~~~~~~
udev-rules.c:341:41: error: ‘struct udev_ruleshas no member namedbuf341 |                                   &rules->buf[token->rule.label_off]);
      |                                         ^~
../../src/shared/log.h:97:70: note: in definition of macrolog_full_errno97 |                 ? log_internal(_l, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \
      |                                                                      ^~~~~~~~~~~
../../src/shared/log.h:104:28: note: in expansion of macrolog_full104 | #define log_debug(...)     log_full(LOG_DEBUG,   __VA_ARGS__)
      |                            ^~~~~~~~
udev-rules.c:338:25: note: in expansion of macrolog_debug338 |                         log_debug("* RULE %s:%u, token: %u, count: %u, label: '%s'",
      |                         ^~~~~~~~~
udev-rules.c: In functiondump_rules’:
udev-rules.c:441:24: error: ‘struct udev_ruleshas no member namedbuf_count441 |                   rules->buf_count,
      |                        ^~
../../src/shared/log.h:97:70: note: in definition of macrolog_full_errno97 |                 ? log_internal(_l, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \
      |                                                                      ^~~~~~~~~~~
../../src/shared/log.h:104:28: note: in expansion of macrolog_full104 | #define log_debug(...)     log_full(LOG_DEBUG,   __VA_ARGS__)
      |                            ^~~~~~~~
udev-rules.c:438:9: note: in expansion of macrolog_debug438 |         log_debug("dumping %u (%zu bytes) tokens, %u (%zu bytes) strings",
      |         ^~~~~~~~~
udev-rules.c:442:24: error: ‘struct udev_ruleshas no member namedbuf_cur442 |                   rules->buf_cur);
      |                        ^~
../../src/shared/log.h:97:70: note: in definition of macrolog_full_errno97 |                 ? log_internal(_l, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \
      |                                                                      ^~~~~~~~~~~
../../src/shared/log.h:104:28: note: in expansion of macrolog_full104 | #define log_debug(...)     log_full(LOG_DEBUG,   __VA_ARGS__)
      |                            ^~~~~~~~
udev-rules.c:438:9: note: in expansion of macrolog_debug438 |         log_debug("dumping %u (%zu bytes) tokens, %u (%zu bytes) strings",
      |         ^~~~~~~~~
Makefile:767: recipe for target 'libudev_core_la-udev-rules.lo' failed

The bug was introduced here:
Link: 915bf0f#diff-86375330bab0167b9f8af6a38146b74a92fbc0ead8936f79ae9295422bda1de2L327

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

Successfully merging a pull request may close this issue.

1 participant