Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#6 Fix build with gcc3

open
nobody
None
5
2003-07-18
2003-07-18
Julio Merino
No

tdb fails to build when using gcc3. The problem is that it does not
allow multiple line strings (which seem to be an old K&R thing).
The fix is to quote each line, add \n's where appropiate and
backslashes at the end of all lines. The attached patch fixes it.

Discussion

  • Julio Merino
    Julio Merino
    2003-07-18

    Sample patch

     
    Attachments
  • Logged In: YES
    user_id=671203

    I got this error:

    /opt/csw/gcc3/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.
    -mcpu=v9 -c tdbtool.c
    tdbtool.c:172:16: missing terminating " character
    tdbtool.c: In function `help':
    tdbtool.c:173: error: parse error before "tdbtool"
    tdbtool.c:187: error: stray '\' in program
    tdbtool.c:187: error: stray '\' in program
    tdbtool.c:187:34: warning: multi-character character constant
    tdbtool.c:188:1: missing terminating " character

    It's this code:
    static void help(void)
    {
    printf("
    tdbtool:
    create dbname : create a database
    open dbname : open an existing database
    erase : erase the database
    dump dumpname : dump the database as strings
    insert key data : insert a record
    store key data : store a record (replace)
    show key : show a record by key
    delete key : delete a record by key
    list : print the database hash table and
    freelist
    free : print the database freelist
    1 | first : print the first record
    n | next : print the next record
    q | quit : terminate
    \\n : repeat 'next' command
    ");
    }

    Same problem? It does compile if i remove that code.