Skip to content

Commit 66ee79c

Browse files
mhansenmalfet
andauthored
Fix Clang CFI type mismatch in src/arm/linux/cpuinfo.c (#403)
Change parse_line signature to accept void* and cast inside. Remove the cast when passing it to cpuinfo_linux_parse_multiline_file. Fixes #402 Co-authored-by: Nikita Shulga <nikita.shulga@gmail.com>
1 parent 8ce83db commit 66ee79c

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/arm/linux/cpuinfo.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,8 @@ struct proc_cpuinfo_parser_state {
729729
* Revision : 0020
730730
* Serial : 0000000000000000
731731
*/
732-
static bool parse_line(
733-
const char* line_start,
734-
const char* line_end,
735-
struct proc_cpuinfo_parser_state state[restrict static 1],
736-
uint64_t line_number) {
732+
static bool parse_line(const char* line_start, const char* line_end, void* context, uint64_t line_number) {
733+
struct proc_cpuinfo_parser_state* restrict state = context;
737734
/* Empty line. Skip. */
738735
if (line_start == line_end) {
739736
return true;
@@ -1024,6 +1021,5 @@ bool cpuinfo_arm_linux_parse_proc_cpuinfo(
10241021
.max_processors_count = max_processors_count,
10251022
.processors = processors,
10261023
};
1027-
return cpuinfo_linux_parse_multiline_file(
1028-
"/proc/cpuinfo", BUFFER_SIZE, (cpuinfo_line_callback)parse_line, &state);
1024+
return cpuinfo_linux_parse_multiline_file("/proc/cpuinfo", BUFFER_SIZE, parse_line, &state);
10291025
}

0 commit comments

Comments
 (0)