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

mcount: Fix a compiler warning on PAGE_SIZE #1882

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

paranlee
Copy link
Contributor

@paranlee paranlee commented Feb 4, 2024

The musl libc defines PAGE_SIZE macro and shows warning like this:

/usr/src/uftrace/libmcount/dynamic.c:43: warning: "PAGE_SIZE" redefined
43 | #define PAGE_SIZE 4096
|
In file included from /usr/include/fortify/stdlib.h:30,
from /usr/src/uftrace/libmcount/dynamic.h:5,
from /usr/src/uftrace/libmcount/dynamic.c:24:
/usr/include/limits.h:97: note: this is the location of the previous definition
97 | #define PAGE_SIZE PAGESIZE

The musl libc defines PAGE_SIZE macro and shows warning like this:

/usr/src/uftrace/libmcount/dynamic.c:43: warning: "PAGE_SIZE" redefined
   43 | #define PAGE_SIZE 4096
      |
In file included from /usr/include/fortify/stdlib.h:30,
                 from /usr/src/uftrace/libmcount/dynamic.h:5,
                 from /usr/src/uftrace/libmcount/dynamic.c:24:
/usr/include/limits.h:97: note: this is the location of the previous definition
   97 | #define PAGE_SIZE PAGESIZE

Signed-off-by: Paran Lee <p4ranlee@gmail.com>
@@ -40,7 +40,6 @@ static struct mcount_dynamic_stats {
int unpatch;
} stats;

#define PAGE_SIZE 4096
Copy link
Contributor Author

Choose a reason for hiding this comment

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

libmcount/dynamic.h have PAGE_SIZE macro.

@namhyung
Copy link
Owner

namhyung commented Feb 4, 2024

I feel like we should not use hard-coded PAGE_SIZE.

Copy link
Owner

@namhyung namhyung left a comment

Choose a reason for hiding this comment

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

LGTM

@namhyung namhyung merged commit 75a1b92 into namhyung:master Feb 8, 2024
3 checks passed
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 this pull request may close these issues.

None yet

2 participants