[PATCH v2] Break out ldconfig parser

Florian Weimer fweimer@redhat.com
Tue Mar 3 18:07:32 GMT 2026


* DJ Delorie:

> Andreas Schwab <schwab@suse.de> writes:
>>> +/* Declared in ldconfig-parse.c */
>>> +typedef void (ldconfig_parse_config_cb) (const char *line,
>>
>> The parens are redundant.
>
> Perhaps, but it helps make it more obvious that it's not a function
> declaration, and parens here are not always redundant.
>
> It's also consistent with existing practice:
>
> argp/argp.h:typedef error_t (*argp_parser_t) (int __key, char *__arg,
> debug/test-strcpy_chk.c:typedef char *(*proto_t) (char *, const char *, size_t);
> elf/dl-tunables.h:typedef void (*tunable_callback_t) (tunable_val_t *);
> elf/ifuncmain1.c:typedef int (*foo_p) (void);
> elf/ifuncmain1vis.c:typedef int (*foo_p) (void);
> elf/ifuncmain3.c:typedef int (*foo_p) (void);
> elf/ifuncmain5.c:typedef int (*foo_p) (void);
> elf/ifuncmain6pie.c:typedef int (*foo_p) (void);
> elf/ifuncmain7.c:typedef int (*foo_p) (void);
> elf/ifuncmod1.c:typedef int (*foo_p) (void);
> elf/ifuncmod6.c:typedef int (*foo_p) (void);
> elf/reldep6.c:typedef int (*fn)(void);
> elf/tst-dl-hash.c:typedef unsigned int (*hash_f) (const char *);
> elf/tst-rootdir.c:  typedef const char *(test_func_t) (void);
> elf/tst-tls-manydynamic.h:typedef void (*set_value_func) (const struct value *);
> elf/tst-tls-manydynamic.h:typedef void (*get_value_func) (struct value *);

These are function pointer types, but yours is a function type.
Maybe you should use a function pointer type instead?

Thanks,
Florian



More information about the Libc-alpha mailing list