diff mbox series

[v2] style: label followed by a declaration is a C23 extension

Message ID 20240919064738.79121-1-michael.adler@siemens.com
State Accepted
Headers show
Series [v2] style: label followed by a declaration is a C23 extension | expand

Commit Message

Michael Adler Sept. 19, 2024, 6:47 a.m. UTC
This fixes a (clang) compiler warning.

Reported-by: Christian Storm <christian.storm@siemens.com>
Signed-off-by: Michael Adler <michael.adler@siemens.com>
Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 core/swupdate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic Sept. 20, 2024, 7:27 a.m. UTC | #1
On 19.09.24 08:47, 'Michael Adler' via swupdate wrote:
> This fixes a (clang) compiler warning.
> 
> Reported-by: Christian Storm <christian.storm@siemens.com>
> Signed-off-by: Michael Adler <michael.adler@siemens.com>
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>   core/swupdate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/swupdate.c b/core/swupdate.c
> index dc818599..ddb6ffe1 100644
> --- a/core/swupdate.c
> +++ b/core/swupdate.c
> @@ -522,6 +522,7 @@ int main(int argc, char **argv)
>   	 * Parse once the command line just to find if a
>   	 * configuration file is passed
>   	 */
> +	int fd;
>   	while ((c = getopt_long(argc, argv, main_options,
>   				long_options, NULL)) != EOF) {
>   		switch (c) {
> @@ -539,7 +540,6 @@ int main(int argc, char **argv)
>   			exit(EXIT_SUCCESS);
>   			break;
>   		case 'E':
> -			int fd;
>   			fd = open(optarg, O_RDONLY);
>   			if (fd < 0)
>   				exit(EXIT_FAILURE);

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/swupdate.c b/core/swupdate.c
index dc818599..ddb6ffe1 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -522,6 +522,7 @@  int main(int argc, char **argv)
 	 * Parse once the command line just to find if a
 	 * configuration file is passed
 	 */
+	int fd;
 	while ((c = getopt_long(argc, argv, main_options,
 				long_options, NULL)) != EOF) {
 		switch (c) {
@@ -539,7 +540,6 @@  int main(int argc, char **argv)
 			exit(EXIT_SUCCESS);
 			break;
 		case 'E':
-			int fd;
 			fd = open(optarg, O_RDONLY);
 			if (fd < 0)
 				exit(EXIT_FAILURE);