Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix gcc 6.2 builds
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 1 Jan 2017 20:56:54 +0000 (21:56 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 1 Jan 2017 20:57:12 +0000 (21:57 +0100)
It was failing with the error: type 'struct yy_buffer_state'
violates the C++ One Definition Rule.  A different type is defined in
another translation unit.

This comes from the fact that I rebuilt one of the flex parser with a
new version of flex. Rebuilding all of them is difficult because they
are somehow manually edited to make the C compile with g++.
Dirty, dirty :(

src/simdag/dax_dtd.c

index bb9d481..82071a5 100644 (file)
@@ -241,7 +241,7 @@ struct yy_buffer_state
        /* Size of input buffer in bytes, not including room for EOB
         * characters.
         */
-       yy_size_t yy_buf_size;
+       int yy_buf_size;
 
        /* Number of characters read into yy_ch_buf, not including EOB
         * characters.
@@ -3076,7 +3076,7 @@ static int yy_get_next_buffer (void)
        else
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
-       if ((unsigned int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+       if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
                /* Extend the array by 50%, plus the number we really need. */
                int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
                YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) dax_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );