seanm wrote:
Another interesting case:
```c++
static int testToWindowsExtendedPath()
{
#ifdef _WIN32
// lots of real, non constant work
return ret;
#else
return 0;
#endif
}
```
For some platforms this can be constexpr; for other platforms (Windows), it
cannot. It was transformed to `cons
seanm wrote:
I've tried another project: [opencv](https://github.com/opencv/opencv) and the
result also fails to compile.
One case I think is because two variables are declared together. i.e.:
```
int foo, bar;
```
instead of:
```
int foo;
int bar;
```
Concretely:
```c++
const char * c
seanm wrote:
> > This actually compiles, though with a `-Wduplicate-decl-specifier` warning.
>
> I failed to reproduce this...
I don't have a minimal repro case, I was building
[VTK](https://gitlab.kitware.com/vtk/vtk). It's pretty simple to build it
yourself if you're familiar with CMake. I
seanm wrote:
Another interesting case, it seems somehow multiple constexprs got added, ex:
```c++
template
constexpr constexpr constexpr constexpr constexpr constexpr constexpr constexpr
int numberOfSidesOfDimension(int dimension);
```
This actually compiles, though with a `-Wduplicate-decl-s
seanm wrote:
Another compiler error after transformation:
It made this constexpr:
```c++
PUGI_IMPL_FN constexpr bool is_nan(double value)
{
#if defined(PUGI_IMPL_MSVC_CRT_VERSION) || defined(__BORLANDC__)
return !!_isnan(value);
#elif defined(fpcl
seanm wrote:
I tried with [ITK](https://github.com/InsightSoftwareConsortium/ITK/) and the
resulting transformation did not compile.
Many changes were of this form:
```diff
-const double Max = 1.0 - Min;
+constexpr double Max = 1.0 - Min;
```
Which is great, though notice the
seanm wrote:
Obj-C, being a superset of C, often has C code within it too, would this change
mean that NULL -> nullptr won't be suggested at all?
Also, isn't Obj-C nil defined as nullptr? I'm pretty sure it is in Obj-C++ at
least.
https://github.com/llvm/llvm-project/pull/141229
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) {
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}}
if (errno) {} // no warning
- } else if (Path == NULL) {
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) {
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}}
if (errno) {} // no warning
- } else if (Path == NULL) {
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) {
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}}
if (errno) {} // no warning
- } else if (Path == NULL) {
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) {
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}}
if (errno) {} // no warning
- } else if (Path == NULL) {
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) {
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}}
if (errno) {} // no warning
- } else if (Path == NULL) {
https://github.com/seanm edited https://github.com/llvm/llvm-project/pull/135720
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) {
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}}
if (errno) {} // no warning
- } else if (Path == NULL) {
https://github.com/seanm updated
https://github.com/llvm/llvm-project/pull/135720
>From cfd32680ac4a534b4060d8cc3549edfe45e721bf Mon Sep 17 00:00:00 2001
From: Sean McBride
Date: Mon, 14 Apr 2025 20:58:24 -0400
Subject: [PATCH] Fixed issue #128882: don't warn if 1st argument to 'getcwd'
is NUL
https://github.com/seanm created
https://github.com/llvm/llvm-project/pull/135720
None
>From 4ce75d43c62537a7020da0ca737c76e0cca27aca Mon Sep 17 00:00:00 2001
From: Sean McBride
Date: Mon, 14 Apr 2025 20:58:24 -0400
Subject: [PATCH] Fixed issue #128882: don't warn if 1st argument to 'getcwd'
seanm wrote:
@fhahn can TySan be made to trap when it detects a problem? I tried
`-fsanitize-trap=type` but got:
`clang++: error: unsupported argument 'type' to option '-fsanitize-trap='`
`-fsanitize-trap=all` does not seem to result in TySan trapping, only logging...
https://github.com/llvm
seanm wrote:
@bwendling thanks for your reply. No idea how representative it is of other
projects, but 3 of the 6 flexible arrays in
[libusb](https://github.com/libusb/libusb) structures have these kinds of
non-trivial counts.
The GCC folks seem to have
[considered](https://gcc.gnu.org/bugzi
seanm wrote:
@bwendling is there any plan / possibility for simple expressions (with no side
effects)? Like:
```c
struct libusb_bos_dev_capability_descriptor {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bDevCapabilityType;
uint8_t dev_capability_data[
Friendly ping... this is a very trivial documentation patch...
On Wed, 10 Aug 2016 13:57:07 -0400, Sean McBride via cfe-commits said:
>Fixed incorrect docs that referred to:
> objc_arc_weak_unavailable
>when it should be:
> objc_arc_weak_reference_unavailable
>
&
Fixed incorrect docs that referred to:
objc_arc_weak_unavailable
when it should be:
objc_arc_weak_reference_unavailable
Cheers,
Sean
objc_arc_weak_unavailable-typo.patch
Description: Binary data
___
cfe-commits mailing list
cfe-commits@lists.llvm.or
On Thu, 7 Apr 2016 15:48:56 +, Alexander Kornienko via cfe-commits said:
>Actually, did you think about adding this as a clang diagnostic?
>
>Richard, what do you think about complaining in Clang about `int i =
>true;` kind of code?
If you don't mind a lurker interjecting... :) I think that'
22 matches
Mail list logo