ccotter wrote:
Oh, you are entirely right. I completely missed that gcc had this check. All of
my test cases are covered by gcc's check, and gcc's check is a bit smarter than
mine (`sprintf(stp->buf, "%s", st1.buf)` is caught by gcc, but not my check).
Is this still worth adding here? I didn't
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/20] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/21] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter edited
https://github.com/llvm/llvm-project/pull/114244
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ccotter wrote:
Ok, all comments should be addressed. The check now uses
`areStatementsIdentical` to more generically find buggy patterns (thanks for
that suggestion!).
https://github.com/llvm/llvm-project/pull/114244
___
cfe-commits mailing list
cfe-
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/19] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/18] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/17] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/16] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/15] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/13] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
@@ -0,0 +1,82 @@
+//===--- UndefinedSprintfOverlapCheck.cpp - clang-tidy
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/12] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
@@ -0,0 +1,82 @@
+//===--- UndefinedSprintfOverlapCheck.cpp - clang-tidy
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/12] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 01/10] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
ccotter wrote:
Thanks both @nicovank @5chmidti for the overlapping reviews. I got sidetracked,
but am coming back to hopefully finish this up.
Re: supporting more use cases, I found nearly all bugs in our codebase were of
the simple form `sprintf(a, "", ..., a, ...)` with a simple DeclRefExpr.
@@ -0,0 +1,23 @@
+.. title:: clang-tidy - bugprone-undefined-sprintf-overlap
+
+bugprone-undefined-sprintf-overlap
ccotter wrote:
I like this better. I'll change this.
https://github.com/llvm/llvm-project/pull/114244
_
ccotter wrote:
> 1. How common is this bug?
In one of our internal codebases, a sample of about 1500 files found just over
2% of the files had this bug. As we migrated platforms/standard libraries, the
behavior which was previously correct (by chance) changed to be incorrect.
> 2. What happen
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 1/8] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTidyM
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 1/6] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTidyM
ccotter wrote:
@PiotrZSL @5chmidti mind giving this a review?
https://github.com/llvm/llvm-project/pull/114244
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 1/5] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTidyM
ccotter wrote:
While working on #114244, I noticed the use of `auto` in
`memberHasSameNameAsBoundNode`. The only other place I could find using `auto`
with `Nodes.getNode` was in the second file I changed.
https://github.com/llvm/llvm-project/pull/114427
___
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 1/4] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTidyM
https://github.com/ccotter edited
https://github.com/llvm/llvm-project/pull/114244
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 1/2] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTidyM
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTidyModul
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/114244
>From 835540fb51517eb2b9e80a7c3b23988419cfc962 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH 1/3] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTidyM
https://github.com/ccotter created
https://github.com/llvm/llvm-project/pull/114244
None
>From 835540fb51517eb2b9e80a7c3b23988419cfc962 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Wed, 30 Oct 2024 10:54:49 -0400
Subject: [PATCH] Add bugprone-sprintf-overlap
---
.../bugprone/BugproneTid
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/101450
>From f7e7681db6ad83878fd00cf250047c98b1b4f051 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Tue, 23 Jul 2024 10:30:54 -0400
Subject: [PATCH 1/4] [clang-tidy] Add support for bsl::optional
---
clang-tools-
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/101450
>From f7e7681db6ad83878fd00cf250047c98b1b4f051 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Tue, 23 Jul 2024 10:30:54 -0400
Subject: [PATCH 1/3] [clang-tidy] Add support for bsl::optional
---
clang-tools-
ccotter wrote:
bump @ymand @PiotrZSL?
https://github.com/llvm/llvm-project/pull/101450
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ccotter wrote:
bump @ymand @PiotrZSL?
https://github.com/llvm/llvm-project/pull/101450
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/101450
>From f7e7681db6ad83878fd00cf250047c98b1b4f051 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Tue, 23 Jul 2024 10:30:54 -0400
Subject: [PATCH 1/3] [clang-tidy] Add support for bsl::optional
---
clang-tools-
ccotter wrote:
@ymand could you please re-review?
https://github.com/llvm/llvm-project/pull/101450
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -38,10 +38,22 @@
namespace clang {
namespace dataflow {
-static bool isTopLevelNamespaceWithName(const NamespaceDecl &NS,
-llvm::StringRef Name) {
- return NS.getDeclName().isIdentifier() && NS.getName() == Name &&
- NS.getPa
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/101450
>From f7e7681db6ad83878fd00cf250047c98b1b4f051 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Tue, 23 Jul 2024 10:30:54 -0400
Subject: [PATCH 1/3] [clang-tidy] Add support for bsl::optional
---
clang-tools-
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/101450
>From f7e7681db6ad83878fd00cf250047c98b1b4f051 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Tue, 23 Jul 2024 10:30:54 -0400
Subject: [PATCH 1/3] [clang-tidy] Add support for bsl::optional
---
clang-tools-
ccotter wrote:
Agreed it should be configurable.
I updated the docs, would you mind merging if you are OK as I don't have perms?
https://github.com/llvm/llvm-project/pull/101450
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llv
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/101450
>From f7e7681db6ad83878fd00cf250047c98b1b4f051 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Tue, 23 Jul 2024 10:30:54 -0400
Subject: [PATCH 1/2] [clang-tidy] Add support for bsl::optional
---
clang-tools-
https://github.com/ccotter created
https://github.com/llvm/llvm-project/pull/101450
None
>From f7e7681db6ad83878fd00cf250047c98b1b4f051 Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Tue, 23 Jul 2024 10:30:54 -0400
Subject: [PATCH] [clang-tidy] Add support for bsl::optional
---
clang-tool
https://github.com/ccotter approved this pull request.
https://github.com/llvm/llvm-project/pull/92019
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/66169
>From d8c40ccc6744d350b8bc530917accd1d8d87118e Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Mon, 11 Sep 2023 00:05:54 -0400
Subject: [PATCH 1/3] [clang-tidy] Fix bug in modernize-use-emplace
emplace_back ca
https://github.com/ccotter updated
https://github.com/llvm/llvm-project/pull/66169:
>From d8c40ccc6744d350b8bc530917accd1d8d87118e Mon Sep 17 00:00:00 2001
From: Chris Cotter
Date: Mon, 11 Sep 2023 00:05:54 -0400
Subject: [PATCH] [clang-tidy] Fix bug in modernize-use-emplace
emplace_back canno
https://github.com/ccotter review_requested
https://github.com/llvm/llvm-project/pull/66169
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ccotter review_requested
https://github.com/llvm/llvm-project/pull/66169
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ccotter review_requested
https://github.com/llvm/llvm-project/pull/66169
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ccotter review_requested
https://github.com/llvm/llvm-project/pull/66169
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ccotter created
https://github.com/llvm/llvm-project/pull/66169:
emplace_back cannot construct an aggregate with arguments used to initialize
the aggregate.
Closes #62387
Test plan: Added test test from #62387 which contains code that should not be
replaced by the check.
>
50 matches
Mail list logo