View Single Post
Old 08 June 2018, 09:39   #1242
Romanujan
Registered User
 
Join Date: Dec 2007
Location: Szczecin/Poland
Posts: 291
I have just upgraded LLVM to 6.0 on my Linux, and I can't compile FS-UAE with it:

Code:
src/blkdev.cpp:758:40: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[10] = {0x4b,0,0,0,0,0,0,0,paused?0:1,0};
                                                     ^~~~~~~~~~
src/blkdev.cpp:758:40: note: insert an explicit cast to silence this issue
                uae_u8 cmd[10] = {0x4b,0,0,0,0,0,0,0,paused?0:1,0};
                                                     ^~~~~~~~~~
                                                     static_cast<uae_u8>( )                                                                                                                                          
src/blkdev.cpp:896:32: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                             ^~~~~~~~~~~
src/blkdev.cpp:896:32: note: insert an explicit cast to silence this issue
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                             ^~~~~~~~~~~
                                             static_cast<uae_u8>( )                                                                                                                                                  
src/blkdev.cpp:896:45: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                          ^~~~~~~~~~~
src/blkdev.cpp:896:45: note: insert an explicit cast to silence this issue
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                          ^~~~~~~~~~~
                                                          static_cast<uae_u8>( )                                                                                                                                     
src/blkdev.cpp:896:58: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                                       ^~~~~~~~~~
src/blkdev.cpp:896:58: note: insert an explicit cast to silence this issue
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                                       ^~~~~~~~~~
                                                                       static_cast<uae_u8>( )                                                                                                                        
src/blkdev.cpp:896:70: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                                                   ^~~~~~~~~~
src/blkdev.cpp:896:70: note: insert an explicit cast to silence this issue
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                                                   ^~~~~~~~~~
                                                                                   static_cast<uae_u8>( )                                                                                                            
src/blkdev.cpp:896:85: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                                                                  ^~~~~~~~~
src/blkdev.cpp:896:85: note: insert an explicit cast to silence this issue
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                                                                  ^~~~~~~~~
                                                                                                  static_cast<uae_u8>( )                                                                                             
src/blkdev.cpp:896:96: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                                                                             ^~~~~~~~~
src/blkdev.cpp:896:96: note: insert an explicit cast to silence this issue
                uae_u8 cmd1[12] = { 0x28, 0, block >> 24, block >> 16, block >> 8, block >> 0, 0, size >> 8, size >> 0, 0, 0, 0 };
                                                                                                             ^~~~~~~~~
                                                                                                             static_cast<uae_u8>( )                                                                                  
src/blkdev.cpp:918:31: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                            ^~~~~~~~~~~
src/blkdev.cpp:918:31: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                            ^~~~~~~~~~~
                                            static_cast<uae_u8>( )                                                                                                                                                   
src/blkdev.cpp:918:44: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                         ^~~~~~~~~~~
src/blkdev.cpp:918:44: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                         ^~~~~~~~~~~
                                                         static_cast<uae_u8>( )                                                                                                                                      
src/blkdev.cpp:918:57: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                      ^~~~~~~~~~
src/blkdev.cpp:918:57: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                      ^~~~~~~~~~
                                                                      static_cast<uae_u8>( )                                                                                                                         
src/blkdev.cpp:918:69: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                  ^~~~~~~~~~
src/blkdev.cpp:918:69: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                  ^~~~~~~~~~
                                                                                  static_cast<uae_u8>( )                                                                                                             
src/blkdev.cpp:918:81: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                              ^~~~~~~~~~
src/blkdev.cpp:918:81: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                              ^~~~~~~~~~
                                                                                              static_cast<uae_u8>( )                                                                                                 
src/blkdev.cpp:918:93: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                                          ^~~~~~~~~
src/blkdev.cpp:918:93: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                                          ^~~~~~~~~
                                                                                                          static_cast<uae_u8>( )                                                                                     
src/blkdev.cpp:918:104: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                                                     ^~~~~~~~~
src/blkdev.cpp:918:104: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                                                     ^~~~~~~~~
                                                                                                                     static_cast<uae_u8>( )                                                                          
src/blkdev.cpp:934:31: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                            ^~~~~~~~~~~
src/blkdev.cpp:934:31: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                            ^~~~~~~~~~~
                                            static_cast<uae_u8>( )                                                                                                                                                   
src/blkdev.cpp:934:44: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                         ^~~~~~~~~~~
src/blkdev.cpp:934:44: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                         ^~~~~~~~~~~
                                                         static_cast<uae_u8>( )                                                                                                                                      
src/blkdev.cpp:934:57: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                      ^~~~~~~~~~
src/blkdev.cpp:934:57: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                      ^~~~~~~~~~
                                                                      static_cast<uae_u8>( )                                                                                                                         
src/blkdev.cpp:934:69: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                  ^~~~~~~~~~
src/blkdev.cpp:934:69: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                  ^~~~~~~~~~
                                                                                  static_cast<uae_u8>( )
src/blkdev.cpp:934:81: error: non-constant-expression cannot be narrowed from type 'int' to 'uae_u8' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                              ^~~~~~~~~~
src/blkdev.cpp:934:81: note: insert an explicit cast to silence this issue
                uae_u8 cmd[12] = { 0xbe, 0, block >> 24, block >> 16, block >> 8, block >> 0, size >> 16, size >> 8, size >> 0, 0x10, 0, 0 };
                                                                                              ^~~~~~~~~~
                                                                                              static_cast<uae_u8>( )
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
EDIT: After applying workaround as the compiler suggest, more problems can be found:

Code:
src/filesys.cpp:342:16: warning: address of array 'uci->ci.rootdir' will always evaluate to 'true' [-Wpointer-bool-conversion]
                        if (uci->ci.rootdir && _tcslen (uci->ci.rootdir) == 0)
                            ~~~~~~~~^~~~~~~ ~~
src/filesys.cpp:2148:77: warning: address of array 'ci->rootdir' will always evaluate to 'true' [-Wpointer-bool-conversion]
                                write_log (_T("HARDFILE: delayed insert %d: '%s'\n"), hfd->unitnum, ci->rootdir ? ci->rootdir : _T("<none>"));
                                                                                                    ~~~~^~~~~~~ ~
src/filesys.cpp:2168:79: warning: address of array 'hfd->ci.rootdir' will always evaluate to 'true' [-Wpointer-bool-conversion]
                        write_log (_T("HARDFILE: delayed eject %d: '%s'\n"), hfd->unitnum, hfd->ci.rootdir ? hfd->ci.rootdir : _T("<none>"));
                                                                                           ~~~~~~~~^~~~~~~ ~
These I would prefer not to fix with a quick&dirty workaround...

Last edited by Romanujan; 08 June 2018 at 10:06. Reason: Additional info
Romanujan is offline  
 
Page generated in 0.04027 seconds with 11 queries