Conversation
fixes:
../arraylist.c: In function 'array_list_new':
../arraylist.c:34:49: warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
34 | if(!(arr->array = (void**)calloc(sizeof(void*), arr->size))) {
| ^~~~
../arraylist.c:34:49: note: earlier argument should specify number of elements, later size of each element
../json_object.c: In function 'fjson_object_new':
../json_object.c:217:78: warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
217 | struct fjson_object *const jso = (struct fjson_object*)calloc(sizeof(struct fjson_object), 1);
| ^~~~~~
../json_object.c:217:78: note: earlier argument should specify number of elements, later size of each element
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Summary of ChangesHello @heitbaum, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request corrects the order of arguments in calls to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes transposed arguments in calloc calls within arraylist.c and json_object.c. These changes address the -Wcalloc-transposed-args compiler warnings, improving code correctness and clarity. The fixes are straightforward and well-implemented. The changes look good to me.
fixes:
Summary by cubic
Fixed transposed calloc arguments to use (elements, size) and remove -Wcalloc-transposed-args build warnings. This makes allocations clearer and avoids potential issues.
Written for commit 490df88. Summary will update on new commits.