SQLite Android Bindings

Ticket Change Details
Login
Overview

Artifact ID: 0afc464dd11fa2298d46cbd1116954187a50ed75
Ticket: 28d442a2c39bd54683a6ff74467336939e305a7e
Build error when SQLITE_ENABLE_BATCH_ATOMIC_WRITE is set because of ambiguous cast
User & Date: anonymous 2018-09-05 12:50:23
Changes

  1. foundin changed to: "latest"
  2. icomment:
    Before Android NDK r17, there was only one ioctl() function defined.
        int ioctl(int __fd, int __request, ...);
    
    However, since Android NDK r17, another one has been added:
        int ioctl(int __fd, unsigned __request, ...)
    
    
    When compiling SQLite with SQLITE_ENABLE_BATCH_ATOMIC_WRITE this will produce a build error since clang does not know which ioctl() function to cast, since sqlite2_syscall_ptr is defined as:
        typedef void (*sqlite3_syscall_ptr)(void);
    
    
    ====
    [x86_64] Compile        : sqliteX <= sqlite3.c
      /home/mathieu/Documents/Sources/Temp/SQlite/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:32184:43: error: address of overloaded function 'ioctl' is ambiguous
        { "ioctl",         (sqlite3_syscall_ptr)ioctl,          0 },
                                                ^~~~~
      /home/mathieu/Android/NDK/android-ndk-r17b/sysroot/usr/include/bits/ioctl.h:57:5: note: candidate function has different number of parameters (expected 0 but has 2)
      int ioctl(int __fd, unsigned __request, ...) __overloadable __enable_if(1, "") __RENAME(ioctl);
          ^
      /home/mathieu/Android/NDK/android-ndk-r17b/sysroot/usr/include/bits/ioctl.h:36:5: note: candidate function has different number of parameters (expected 0 but has 2)
      int ioctl(int __fd, int __request, ...);
          ^
      /home/mathieu/Documents/Sources/Temp/SQlite/sqlite/sqlite3/src/main/jni/sqlite/sqlite3.c:32184:22: error: initializer element is not a compile-time constant
        { "ioctl",         (sqlite3_syscall_ptr)ioctl,          0 },
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
      2 errors generated.
      make: *** [/home/mathieu/Documents/Sources/Temp/SQlite/sqlite/sqlite3/build/intermediates/ndkBuild/release/obj/local/x86_64/objs/sqliteX/sqlite3.o] Error 1
    ====
    
  3. login: "anonymous"
  4. mimetype: "text/x-fossil-plain"
  5. private_contact changed to: "6ae8e4e99f463d5364ed5168b893c32b24d7ca5f"
  6. severity changed to: "Severe"
  7. status changed to: "Open"
  8. title changed to:
    Build error when SQLITE_ENABLE_BATCH_ATOMIC_WRITE is set because of ambiguous cast
    
  9. type changed to: "Code_Defect"