Note that there are some explanatory texts on larger screens.

plurals
  1. POcompilation error about exceptions
    text
    copied!<p>I met some compilation error but do not know what the problem is. The code seems not use exception, but the error is about it.</p> <pre><code>//in misc.h: char *basename(char *name); // line 94 // in misc.cc: char *basename(char *name) { // line 12 char *result = name; while(*name) { if(*name == '/') result = name + 1; name++; } return result; } </code></pre> <p>Compilation error</p> <pre><code>g++ -pipe -W -Wall -fopenmp -ggdb3 -O2 -c -o misc.o ../../src/misc.cc ../../src/misc.cc: In function ‘char* basename(char*)’: ../../src/misc.cc:12: error: declaration of ‘char* basename(char*)’ throws different exceptions ../../src/misc.h:94: error: from previous declaration ‘char* basename(char*) throw ()’ make: *** [misc.o] Error 1 </code></pre> <p>Does someone have some clue? Thanks and regards!</p> <hr> <p>EDIT: Files included in misc.h are</p> <pre><code>#include &lt;iostream&gt; #include &lt;cmath&gt; #include &lt;fstream&gt; #include &lt;cfloat&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; </code></pre> <hr> <p>EDIT: in misc.i generated by -E option, </p> <pre><code>extern "C++" char *basename (char *__filename) throw () __asm ("basename") __attribute__ ((__nonnull__ (1))); extern "C++" __const char *basename (__const char *__filename) throw () __asm ("basename") __attribute__ ((__nonnull__ (1))); # 640 "/usr/include/string.h" 3 4 # 1 "/usr/include/bits/string3.h" 1 3 4 # 23 "/usr/include/bits/string3.h" 3 4 extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("memset used with constant zero length parameter; this could be due to transposed parameters"))); # 48 "/usr/include/bits/string3.h" 3 4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void * memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len) throw () { return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); } ... # 641 "/usr/include/string.h" 2 3 4 ... </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload