public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97658] New: Tired of having to change make files on every new version. Damnit!
@ 2020-10-31 17:11 hubert.vansteenhuyse at freecode dot be
  2020-10-31 18:11 ` [Bug c++/97658] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hubert.vansteenhuyse at freecode dot be @ 2020-10-31 17:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97658

            Bug ID: 97658
           Summary: Tired of having to change make files on every new
                    version. Damnit!
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubert.vansteenhuyse at freecode dot be
  Target Milestone: ---

src/MAL/utils/utils.hpp:600:10: note: ‘struct
HASHTABLE<PROJECTILE_CACHE*>::CONTAINER’ declared here
  600 |   struct CONTAINER {
      |          ^~~~~~~~~
src/MAL/utils/utils.hpp: In instantiation of ‘void HASHTABLE<T>::reset() [with
T = PROJECTILE*]’:
src/game/game.hpp:431:19:   required from here
src/MAL/utils/utils.hpp:691:11: warning: ‘void* memset(void*, int, size_t)’
clearing an object of non-trivial type ‘struct
HASHTABLE<PROJECTILE*>::CONTAINER’; use assignment or value-initialization
instead [-Wclass-memaccess]
  691 |     memset(this->data.array, 0, sizeof(CONTAINER) *
this->data.elems());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/MAL/utils/utils.hpp:600:10: note: ‘struct
HASHTABLE<PROJECTILE*>::CONTAINER’ declared here
  600 |   struct CONTAINER {
      |          ^~~~~~~~~
src/MAL/utils/utils.hpp: In instantiation of ‘void HASHTABLE<T>::reset() [with
T = PROFILE*]’:
src/game/bots.cpp:330:16:   required from here
src/MAL/utils/utils.hpp:691:11: warning: ‘void* memset(void*, int, size_t)’
clearing an object of non-trivial type ‘struct HASHTABLE<PROFILE*>::CONTAINER’;
use assignment or value-initialization instead [-Wclass-memaccess]
  691 |     memset(this->data.array, 0, sizeof(CONTAINER) *
this->data.elems());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/MAL/utils/utils.hpp:600:10: note: ‘struct HASHTABLE<PROFILE*>::CONTAINER’
declared here
  600 |   struct CONTAINER {
      |          ^~~~~~~~~
src/MAL/utils/utils.hpp: In instantiation of ‘void HASHTABLE<T>::reset() [with
T = BOT*]’:
src/game/bots.cpp:1847:15:   required from here
src/MAL/utils/utils.hpp:691:11: warning: ‘void* memset(void*, int, size_t)’
clearing an object of non-trivial type ‘struct HASHTABLE<BOT*>::CONTAINER’; use
assignment or value-initialization instead [-Wclass-memaccess]
  691 |     memset(this->data.array, 0, sizeof(CONTAINER) *
this->data.elems());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/MAL/utils/utils.hpp:600:10: note: ‘struct HASHTABLE<BOT*>::CONTAINER’
declared here
  600 |   struct CONTAINER {
      |          ^~~~~~~~~
src/MAL/utils/utils.hpp: In instantiation of ‘void HASHTABLE<T>::reset() [with
T = TREE*]’:
src/MAL/utils/utils.hpp:684:4:   required from ‘HASHTABLE<T>::HASHTABLE(int)
[with T = TREE*]’
src/octree.hpp:1233:19:   required from here
src/MAL/utils/utils.hpp:691:11: warning: ‘void* memset(void*, int, size_t)’
clearing an object of non-trivial type ‘struct HASHTABLE<TREE*>::CONTAINER’;
use assignment or value-initialization instead [-Wclass-memaccess]
  691 |     memset(this->data.array, 0, sizeof(CONTAINER) *
this->data.elems());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/MAL/utils/utils.hpp:600:10: note: ‘struct HASHTABLE<TREE*>::CONTAINER’
declared here
  600 |   struct CONTAINER {
      |          ^~~~~~~~~
src/MAL/utils/utils.hpp: In instantiation of ‘void HASHTABLE<T>::reset() [with
T = LIST<GEORECT*>*]’:
src/MAL/utils/utils.hpp:684:4:   required from ‘HASHTABLE<T>::HASHTABLE(int)
[with T = LIST<GEORECT*>*]’
src/octedit.hpp:1307:30:   required from here
src/MAL/utils/utils.hpp:691:11: warning: ‘void* memset(void*, int, size_t)’
clearing an object of non-trivial type ‘struct
HASHTABLE<LIST<GEORECT*>*>::CONTAINER’; use assignment or value-initialization
instead [-Wclass-memaccess]
  691 |     memset(this->data.array, 0, sizeof(CONTAINER) *
this->data.elems());
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/MAL/utils/utils.hpp:600:10: note: ‘struct
HASHTABLE<LIST<GEORECT*>*>::CONTAINER’ declared here
  600 |   struct CONTAINER {
      |          ^~~~~~~~~

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97658] Tired of having to change make files on every new version. Damnit!
  2020-10-31 17:11 [Bug c++/97658] New: Tired of having to change make files on every new version. Damnit! hubert.vansteenhuyse at freecode dot be
@ 2020-10-31 18:11 ` redi at gcc dot gnu.org
  2020-11-02 21:58 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2020-10-31 18:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97658

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The compiler is telling you your code has undefined behaviour.

If you write code that conforms to the rules of the C++ language, you won't get
that warning.

Don't change your makefiles, fix your code.

I don't see any GCC bug here.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97658] Tired of having to change make files on every new version. Damnit!
  2020-10-31 17:11 [Bug c++/97658] New: Tired of having to change make files on every new version. Damnit! hubert.vansteenhuyse at freecode dot be
  2020-10-31 18:11 ` [Bug c++/97658] " redi at gcc dot gnu.org
@ 2020-11-02 21:58 ` pinskia at gcc dot gnu.org
  2020-11-03 10:43 ` hubert.vansteenhuyse at freecode dot be
  2020-11-03 10:46 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-11-02 21:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97658

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So just going to mention this, GCC adds new warnings every version as we are
trying to improve the things and warn the user about undefinedness and even
some other questionable things (which usually leads to not what the user
expects).  The warnings we add are controllable and all.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97658] Tired of having to change make files on every new version. Damnit!
  2020-10-31 17:11 [Bug c++/97658] New: Tired of having to change make files on every new version. Damnit! hubert.vansteenhuyse at freecode dot be
  2020-10-31 18:11 ` [Bug c++/97658] " redi at gcc dot gnu.org
  2020-11-02 21:58 ` pinskia at gcc dot gnu.org
@ 2020-11-03 10:43 ` hubert.vansteenhuyse at freecode dot be
  2020-11-03 10:46 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: hubert.vansteenhuyse at freecode dot be @ 2020-11-03 10:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97658

--- Comment #3 from hubert.vansteenhuyse at freecode dot be ---
You are killing that marvelous gcc compiler by doing this, this is my point.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97658] Tired of having to change make files on every new version. Damnit!
  2020-10-31 17:11 [Bug c++/97658] New: Tired of having to change make files on every new version. Damnit! hubert.vansteenhuyse at freecode dot be
                   ` (2 preceding siblings ...)
  2020-11-03 10:43 ` hubert.vansteenhuyse at freecode dot be
@ 2020-11-03 10:46 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-03 10:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97658

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Nonsense. Your code is buggy, the warning tells you about it.

If you don't want to know that your code has undefined behaviour, don't enable
warnings.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-03 10:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-31 17:11 [Bug c++/97658] New: Tired of having to change make files on every new version. Damnit! hubert.vansteenhuyse at freecode dot be
2020-10-31 18:11 ` [Bug c++/97658] " redi at gcc dot gnu.org
2020-11-02 21:58 ` pinskia at gcc dot gnu.org
2020-11-03 10:43 ` hubert.vansteenhuyse at freecode dot be
2020-11-03 10:46 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).