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

Fix log.cpp when compiled with executorch.enable_et_log=false #4358

Closed
wants to merge 1 commit into from

Conversation

tarun292
Copy link
Contributor

Summary:
Currently, the ASR execution fails with the following error:
xplat/executorch/runtime/platform/log.cpp:21:25: error: unused variable 'kMaxLogMessageLength' [-Werror,-Wunused-const-variable] (P1484525874).

This diff marks kMaxLogMessageLength as maybe_unused.

Differential Revision: D59641404

Copy link

pytorch-bot bot commented Jul 23, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4358

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit c4a1496 with merge base dbc73a6 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 23, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59641404

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59641404

tarun292 added a commit that referenced this pull request Jul 23, 2024
Summary:
Pull Request resolved: #4358

Currently, the ASR execution fails with the following error:
`xplat/executorch/runtime/platform/log.cpp:21:25: error: unused variable 'kMaxLogMessageLength' [-Werror,-Wunused-const-variable]` (P1484525874).

This diff marks kMaxLogMessageLength as `maybe_unused`.

Differential Revision: D59641404
@@ -18,7 +18,7 @@ namespace executor {
namespace internal {

/// Maximum length of a log message.
static constexpr size_t kMaxLogMessageLength = 256;
__ET_UNUSED static constexpr size_t kMaxLogMessageLength = 256;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't always unused, only when logging is disabled. Instead of annotating it here, please move the definition down into vlogf() inside the #ifdef, then it will only be defined when it's actually used. Or guard this definition with #if ET_LOG_ENABLED so it's only defined when it's actually used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

facebook-github-bot pushed a commit that referenced this pull request Jul 23, 2024
Summary:

Currently, the ASR execution fails with the following error: 
`xplat/executorch/runtime/platform/log.cpp:21:25: error: unused variable 'kMaxLogMessageLength' [-Werror,-Wunused-const-variable]` (P1484525874).

This diff marks kMaxLogMessageLength as `maybe_unused`.

Reviewed By: dvorjackz

Differential Revision: D59641404
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59641404

Summary:
Pull Request resolved: #4358

Currently, the ASR execution fails with the following error:
`xplat/executorch/runtime/platform/log.cpp:21:25: error: unused variable 'kMaxLogMessageLength' [-Werror,-Wunused-const-variable]` (P1484525874).

This diff marks kMaxLogMessageLength as `maybe_unused`.

Reviewed By: dvorjackz

Differential Revision: D59641404
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59641404

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in fd2dccf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants