Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wc23-extensions in net/ipv4/tcp_output.c #1953

Closed
nathanchance opened this issue Oct 31, 2023 · 4 comments
Closed

-Wc23-extensions in net/ipv4/tcp_output.c #1953

nathanchance opened this issue Oct 31, 2023 · 4 comments
Assignees
Labels
-Wc23-extensions [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle

Comments

@nathanchance
Copy link
Member

net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
  663 |         }
      |         ^
1 error generated.

This was a hard error in earlier releases:

net/ipv4/tcp_output.c:663:2: error: expected statement
        }
        ^
1 error generated.

I'll have a patch shortly.

@nathanchance nathanchance added [BUG] linux-next This is an issue only seen in linux-next -Wc23-extensions labels Oct 31, 2023
@nathanchance nathanchance self-assigned this Oct 31, 2023
@nathanchance nathanchance added the [PATCH] Submitted A patch has been submitted for review label Oct 31, 2023
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Oct 31, 2023
Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set:

  net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
    663 |         }
        |         ^
  1 error generated.

On earlier releases (such as clang-11, the current minimum supported
version for building the kernel) that do not support C23, this was a
hard error unconditionally:

  net/ipv4/tcp_output.c:663:2: error: expected statement
          }
          ^
  1 error generated.

Add a semicolon after the label to create an empty statement, which
resolves the warning or error for all compilers.

Closes: ClangBuiltLinux#1953
Fixes: 1e03d32 ("net/tcp: Add TCP-AO sign to outgoing packets")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nickdesaulniers nickdesaulniers added [BUG] linux A bug that should be fixed in the mainline kernel. and removed [BUG] linux-next This is an issue only seen in linux-next labels Nov 1, 2023
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Nov 6, 2023
Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set:

  net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
    663 |         }
        |         ^
  1 error generated.

On earlier releases (such as clang-11, the current minimum supported
version for building the kernel) that do not support C23, this was a
hard error unconditionally:

  net/ipv4/tcp_output.c:663:2: error: expected statement
          }
          ^
  1 error generated.

While adding a semicolon after the label would resolve this, it is more
in line with the kernel as a whole to refactor this block into a
standalone function, which means the goto a label construct can just be
replaced with a simple return. Do so to resolve the warning.

Closes: ClangBuiltLinux#1953
Fixes: 1e03d32 ("net/tcp: Add TCP-AO sign to outgoing packets")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Nov 6, 2023
Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set:

  net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
    663 |         }
        |         ^
  1 error generated.

On earlier releases (such as clang-11, the current minimum supported
version for building the kernel) that do not support C23, this was a
hard error unconditionally:

  net/ipv4/tcp_output.c:663:2: error: expected statement
          }
          ^
  1 error generated.

While adding a semicolon after the label would resolve this, it is more
in line with the kernel as a whole to refactor this block into a
standalone function, which means the goto a label construct can just be
replaced with a return statement. Do so to resolve the warning.

Closes: ClangBuiltLinux#1953
Fixes: 1e03d32 ("net/tcp: Add TCP-AO sign to outgoing packets")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nathanchance
Copy link
Member Author

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Nov 8, 2023
Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set:

  net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
    663 |         }
        |         ^
  1 error generated.

On earlier releases (such as clang-11, the current minimum supported
version for building the kernel) that do not support C23, this was a
hard error unconditionally:

  net/ipv4/tcp_output.c:663:2: error: expected statement
          }
          ^
  1 error generated.

While adding a semicolon after the label would resolve this, it is more
in line with the kernel as a whole to refactor this block into a
standalone function, which means the goto a label construct can just be
replaced with a return statement. Do so to resolve the warning.

Closes: ClangBuiltLinux#1953
Fixes: 1e03d32 ("net/tcp: Add TCP-AO sign to outgoing packets")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Dmitry Safonov <dima@arista.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Nov 8, 2023
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wc23-extensions [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle
Projects
None yet
Development

No branches or pull requests

2 participants