davidmartos96 / sqflite_sqlcipher

SQLite flutter plugin
BSD 2-Clause "Simplified" License
99 stars 44 forks source link

I use it on the macOS platform, and there are a lot of warning messages when compiling. #36

Closed SF-Simon closed 3 years ago

SF-Simon commented 3 years ago

sqflite_sqlcipher: ^2.0.0

This may be a problem with sqlcipher. Quite a lot, I just copied part of it.

Launching lib/main.dart on macOS in debug mode... /Users/xx/../flutter/macos/Pods/SQLCipher/sqlite3.c:33879:25: warning: ambiguous expansion of macro 'MAX' [-Wambiguous-macro] szBufNeeded = MAX(e2,0)+(i64)precision+(i64)width+15; ^ In module 'Darwin' imported from /Users/xx/../flutter/macos/Pods/SQLCipher/sqlite3.c:1088: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/sys/param.h:218:9: note: expanding this definition of 'MAX'

define MAX(a, b) (((a)>(b))?(a):(b))

    ^

/Users/xx/../flutter/macos/Pods/SQLCipher/sqlite3.c:14318:10: note: other definition of 'MAX'

define MAX(A,B) ((A)>(B)?(A):(B))

     ^

/Users/xx/../flutter/macos/Pods/SQLCipher/sqlite3.c:37974:14: warning: implicit conversion loses integer precision: 'sqlite3_int64' (aka 'long long') to 'VList' (aka 'int') [-Wshorten-64-to-32] pIn[0] = nAlloc; ~ ^~ /Users/xx/../flutter/macos/Pods/SQLCipher/sqlite3.c:40084:14: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32] do{ rc = osWrite(fd, "S", 1); }while( rc<0 && errno==EINTR ); ~ ^~~~~~~ /Users/xx/../flutter/macos/Pods/SQLCipher/sqlite3.c:39128:21: note: expanded from macro 'osWrite'

define osWrite ((ssize_t()(int,const void,size_t))aSyscall[11].pCurrent)

                ^

/Users/xx/../flutter/macos/Pods/SQLCipher/sqlite3.c:41829:42: warning: implicit conversion loses integer precision: 'unsigned long long' to 'int' [-Wshorten-64-to-32] int sharedLockByte = SHARED_FIRST+pInode->sharedByte;

davidmartos96 commented 3 years ago

Do you get a crash at the end, or are those "just" warnings? The warnings are generated by the official SqlCipher native library which it is outside this repository. This package is just a wrapper around that library, so I cannot do anything about it. Unfortunately one has to live with those warnings...

SF-Simon commented 3 years ago

These are just warnings and did not crash my app, but there are a lot of warnings, with more than 120 repeated warnings. If there is no way to solve it, it can only be so.

On Tue, Mar 23, 2021 at 9:26 AM David Martos @.***> wrote:

Do you get a crash at the end, or are those "just" warnings? The warnings are generated by the official SqlCipher native library which it is outside this repository. Unfortunately one has to live with those warnings..

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidmartos96/sqflite_sqlcipher/issues/36#issuecomment-804514614, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACV6CII4RF534QCFGI3VX43TE7U3VANCNFSM4ZUGNQBA .

davidmartos96 commented 3 years ago

@HeebeLee Yes, as far as I know, we cannot do anything about it here. I don't know if there are ways to ignore warnings for certain libraries when compiling.