msg_347.c revision 1.7
1/* $NetBSD: msg_347.c,v 1.7 2023/08/02 21:11:35 rillig Exp $ */ 2# 3 "msg_347.c" 3 4// Test for message: redeclaration of '%s' with type '%s', expected '%s' [347] 5 6/* lint1-extra-flags: -r -X 351 */ 7 8/* 9 * Message 27 already covers redeclarations, but it doesn't include enough 10 * details to make any sense of it. 11 */ 12 13/* 14 * Before 2023-08-02, lint did not interpret unnamed function parameters with 15 * complicated types correctly. The named counterparts were no problem, though. 16 */ 17 18void function_parameter(void *, double *(void *, int)); 19void function_parameter(void *fs, double *fn(void *, int)); 20 21 22/* expect+1: warning: struct 'last_arg' never defined [233] */ 23struct last_arg; 24void last_arg_struct(double, double *(struct last_arg *)); 25void last_arg_struct(double d, double *fn(struct last_arg *)); 26 27 28struct last_param { 29 int member; 30}; 31 32void last_param(double, double *(struct last_param)); 33void last_param(double d, double *fn(struct last_param)); 34 35 36/* expect+1: previous declaration of 'mismatch' [260] */ 37void mismatch(double, double *(struct last_param)); 38/* expect+1: error: redeclaration of 'mismatch' with type 'function(double, pointer to function(struct last_param) returning pointer to float) returning void', expected 'function(double, pointer to function(struct last_param) returning pointer to double) returning void' [347] */ 39void mismatch(double d, float *fn(struct last_param)); 40