[FIXED] Latest experimental build can't be compiled with CLANG

UPDATE: Fiexed in 0a8041414030f32e30226f5cebf2301247aba18e

Latest build e597e2697fb496ddd34b3c2df3753a5cb9c4295b (and few before it) can’t be compiled by clang,

In file included from src/iuse.cpp:11: In file included from src/player.h:4: src/character.h:85:21: error: 'get_hit_base' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual int get_hit_base() const; ^ src/creature.h:365:21: note: overridden virtual function is here virtual int get_hit_base() const; ^ In file included from src/iuse.cpp:11: In file included from src/player.h:4: src/character.h:91:22: error: 'reset_bonuses' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset_bonuses(); ^ src/creature.h:56:22: note: overridden virtual function is here virtual void reset_bonuses(); ^ In file included from src/iuse.cpp:11: In file included from src/player.h:4: src/character.h:93:22: error: 'reset_stats' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset_stats(); ^ src/creature.h:58:22: note: overridden virtual function is here virtual void reset_stats(); ^ In file included from src/iuse.cpp:11: In file included from src/player.h:4: src/character.h:95:22: error: 'reset' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset(); ^ src/creature.h:60:22: note: overridden virtual function is here virtual void reset(); ^ In file included from src/sounds.cpp:9: In file included from src/monster.h:5: In file included from src/player.h:4: src/character.h:84:21: error: 'get_dodge_base' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual int get_dodge_base() const; ^ src/creature.h:364:21: note: overridden virtual function is here virtual int get_dodge_base() const; ^ In file included from src/sounds.cpp:9: In file included from src/monster.h:5: In file included from src/player.h:4: src/character.h:85:21: error: 'get_hit_base' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual int get_hit_base() const; ^ src/creature.h:365:21: note: overridden virtual function is here virtual int get_hit_base() const; ^ In file included from src/sounds.cpp:9: In file included from src/monster.h:5: In file included from src/player.h:4: src/character.h:91:22: error: 'reset_bonuses' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset_bonuses(); ^ src/creature.h:56:22: note: overridden virtual function is here virtual void reset_bonuses(); ^ In file included from src/sounds.cpp:9: In file included from src/monster.h:5: In file included from src/player.h:4: src/character.h:93:22: error: 'reset_stats' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset_stats(); ^ src/creature.h:58:22: note: overridden virtual function is here virtual void reset_stats(); ^ In file included from src/sounds.cpp:9: In file included from src/monster.h:5: In file included from src/player.h:4: src/character.h:95:22: error: 'reset' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset(); ^ src/creature.h:60:22: note: overridden virtual function is here virtual void reset(); ^ In file included from src/map.cpp:18: In file included from src/npc.h:4: In file included from src/player.h:4: src/character.h:84:21: error: 'get_dodge_base' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual int get_dodge_base() const; ^ src/creature.h:364:21: note: overridden virtual function is here virtual int get_dodge_base() const; ^ In file included from src/map.cpp:18: In file included from src/npc.h:4: In file included from src/player.h:4: src/character.h:85:21: error: 'get_hit_base' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual int get_hit_base() const; ^ src/creature.h:365:21: note: overridden virtual function is here virtual int get_hit_base() const; ^ In file included from src/map.cpp:18: In file included from src/npc.h:4: In file included from src/player.h:4: src/character.h:91:22: error: 'reset_bonuses' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset_bonuses(); ^ src/creature.h:56:22: note: overridden virtual function is here virtual void reset_bonuses(); ^ In file included from src/map.cpp:18: In file included from src/npc.h:4: In file included from src/player.h:4: src/character.h:93:22: error: 'reset_stats' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset_stats(); ^ src/creature.h:58:22: note: overridden virtual function is here virtual void reset_stats(); ^ In file included from src/map.cpp:18: In file included from src/npc.h:4: In file included from src/player.h:4: src/character.h:95:22: error: 'reset' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] virtual void reset(); ^ src/creature.h:60:22: note: overridden virtual function is here virtual void reset(); ^ 5 errors generated. Makefile:477: recipe for target 'obj/tiles/sounds.o' failed make: *** [obj/tiles/sounds.o] Error 1 make: *** Waiting for unfinished jobs.... 5 errors generated. Makefile:477: recipe for target 'obj/tiles/map.o' failed make: *** [obj/tiles/map.o] Error 1 5 errors generated. Makefile:477: recipe for target 'obj/tiles/iuse.o' failed make: *** [obj/tiles/iuse.o] Error 1

I’m a python programmer, i don’t know C++ enough to repair codebase and put out a pull request. :frowning:

There are no problem with g++

UPDATE:

Below is patch that fixes this issue. You can compile now with clang.

[code]Index: src/character.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8

— src/character.h (revision e597e2697fb496ddd34b3c2df3753a5cb9c4295b)
+++ src/character.h (revision )
@@ -81,18 +81,18 @@
virtual void mod_stat( const std::string &stat, int modifier ) override;

     /** Combat getters */
  •    virtual int get_dodge_base() const;
    
  •    virtual int get_hit_base() const;
    
  •    virtual int get_dodge_base() const override;
    
  •    virtual int get_hit_base() const override;
    
       /** Handles health fluctuations over time */
       virtual void update_health(int base_threshold = 0);
    
       /** Resets the value of all bonus fields to 0. */
    
  •    virtual void reset_bonuses();
    
  •    virtual void reset_bonuses() override;
       /** Resets stats, and applies effects in an idempotent manner */
    
  •    virtual void reset_stats();
    
  •    virtual void reset_stats() override;
       /** Handles stat and bonus reset. */
    
  •    virtual void reset();
    
  •    virtual void reset() override;
    
       /** Processes effects which may prevent the Character from moving (bear traps, crushed, etc.).
        *  Returns false if movement is stopped. */
    

[/code]

I’ll try to make pull request, it’s was so much easier than i anticipated :wink: