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

uftrace: Align exact argument on calloc #1936

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

yskelg
Copy link
Contributor

@yskelg yskelg commented Jun 19, 2024

Align argument for calloc() call in some code and macro in utils.h file.

This patch remove warning on #1933

/home/paran/uftrace/cmds/graph.c:213:53: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  213 |         struct session_graph *graph = xzalloc(sizeof(*graph));
      |                                                     ^
/home/paran/uftrace/utils/utils.h:193:38: note: in definition of macro ‘xzalloc’
  193 |                 void *__ptr = calloc(sz, 1);                                                       \
      |                                      ^~
/home/paran/uftrace/cmds/graph.c:213:53: note: earlier argument should specify number of elements, later size of each element
  213 |         struct session_graph *graph = xzalloc(sizeof(*graph));
      |                                                     ^
/home/paran/uftrace/utils/utils.h:193:38: note: in definition of macro ‘xzalloc’
  193 |                 void *__ptr = calloc(sz, 1);                                                       \
      |                                      ^~

Signed-off-by: Yunseong Kim yskelg@gmail.com

@yskelg yskelg changed the title Align-calloc uftrace: Align exact argument on calloc Jun 19, 2024
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, but please fix typo 'Algin'.

Align argument for calloc call in some code and macro in utils.h file.

Signed-off-by: Yunseong Kim <yskelg@gmail.com>
@yskelg
Copy link
Contributor Author

yskelg commented Jun 19, 2024

Thank you for the code review @namhyung!

@namhyung namhyung merged commit 804ae6b into namhyung:master Jun 19, 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.

2 participants