[Bug c/104822] -Wscalar-storage-order warning for initialization from NULL seems useless

2023-10-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104822

Andrew Pinski  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |14.0

--- Comment #7 from Andrew Pinski  ---
Fixed.

[Bug c/104822] -Wscalar-storage-order warning for initialization from NULL seems useless

2023-10-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104822

--- Comment #6 from CVS Commits  ---
The trunk branch has been updated by Andrew Pinski :

https://gcc.gnu.org/g:9f33e4c50ee92a2053f52e5eb8f205afa54d4cb0

commit r14-4758-g9f33e4c50ee92a2053f52e5eb8f205afa54d4cb0
Author: Andrew Pinski 
Date:   Wed Oct 18 20:49:05 2023 -0700

c: Don't warn about converting NULL to different sso endian [PR104822]

In a similar way we don't warn about NULL pointer constant conversion to
a different named address we should not warn to a different sso endian
either.
This adds the simple check.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR c/104822

gcc/c/ChangeLog:

* c-typeck.cc (convert_for_assignment): Check for null pointer
before warning about an incompatible scalar storage order.

gcc/testsuite/ChangeLog:

* gcc.dg/sso-18.c: New test.
* gcc.dg/sso-19.c: New test.

[Bug c/104822] -Wscalar-storage-order warning for initialization from NULL seems useless

2023-10-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104822

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||patch
URL||https://gcc.gnu.org/piperma
   ||il/gcc-patches/2023-October
   ||/633609.html

--- Comment #5 from Andrew Pinski  ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633609.html

[Bug c/104822] -Wscalar-storage-order warning for initialization from NULL seems useless

2023-10-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104822

--- Comment #4 from Andrew Pinski  ---
Created attachment 56147
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56147&action=edit
Patch which I am testing

[Bug c/104822] -Wscalar-storage-order warning for initialization from NULL seems useless

2022-12-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104822

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> Mine, I think this patch will fix the issue:
Which is similar to the check above dealing with named address spaces.

[Bug c/104822] -Wscalar-storage-order warning for initialization from NULL seems useless

2022-12-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104822

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org

--- Comment #2 from Andrew Pinski  ---
Mine, I think this patch will fix the issue:
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index f1a1752782a..43b9793e339 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -7480,6 +7480,7 @@ convert_for_assignment (location_t location, location_t
expr_loc, tree type,

   /* See if the pointers point to incompatible scalar storage orders.  */
   if (warn_scalar_storage_order
+ && !null_pointer_constant_p (rhs)
  && (AGGREGATE_TYPE_P (ttl) && TYPE_REVERSE_STORAGE_ORDER (ttl))
 != (AGGREGATE_TYPE_P (ttr) && TYPE_REVERSE_STORAGE_ORDER (ttr)))
{

[Bug c/104822] -Wscalar-storage-order warning for initialization from NULL seems useless

2022-03-24 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104822

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org
 Ever confirmed|0   |1
   Severity|normal  |enhancement
   Last reconfirmed||2022-03-24
 Status|UNCONFIRMED |NEW

--- Comment #1 from Eric Botcazou  ---
Indeed, it looks like the warning could be less stupid here.