Skip to content

Commit 361a55a

Browse files
committed
checkpatch: support function pointers for unnamed function definition
Current unnamed function definition argument does not include function pointer cases and it reports warnings like: WARNING: function definition argument 'void' should also have an identifier name +unsigned int (*dummy)(void); Support function pointers for unnamed function arguments. Fixes zephyrproject-rtos#9411 Signed-off-by: Ajay Kishore <[email protected]>
1 parent 1d4e089 commit 361a55a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5973,7 +5973,7 @@ sub process {
59735973

59745974
# check for function declarations that have arguments without identifier names
59755975
if (defined $stat &&
5976-
$stat =~ /^.\s*(?:extern\s+)?$Type\s*$Ident\s*\(\s*([^{]+)\s*\)\s*;/s &&
5976+
$stat =~ /^.\s*(?:extern\s+)?$Type\s*\(?\s*\*?\s*$Ident\s*\)\s*\(\s*([^{]+)\s*\)\s*;/s &&
59775977
$1 ne "void") {
59785978
my $args = trim($1);
59795979
while ($args =~ m/\s*($Type\s*(?:$Ident|\(\s*\*\s*$Ident?\s*\)\s*$balanced_parens)?)/g) {

0 commit comments

Comments
 (0)