4

I have installed CocoaPods.. and loaded the workspace as instructed.

I am getting these warnings which I do not understand, here is an example:

Pods-CipherDatabaseSync-SQLCipher sqlite.c /Users/admin/Code/CipherDatabaseSync/Pods/SQLCipher/sqlite3.c:24035:13: Ambiguous expansion of macro 'MAX'

I have looked around for a couple of hours and I am stumped at what I need to do, can someone please point me in the direction of somewhere that will provide some insight?

Thanks.

Keith Smiley
  • 61,481
  • 12
  • 97
  • 110
Nate Uni
  • 933
  • 1
  • 12
  • 26

3 Answers3

5

In the sqlite.c file it looks as if MIN and MAX are trying to be defined in two different areas of the file. The first time on line 214

/* Macros for min/max. */
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif /* MIN */
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif  /* MAX */

Then secondly at line 8519

/*
** Macros to compute minimum and maximum of two numbers.
*/
#define MIN(A,B) ((A)<(B)?(A):(B))
#define MAX(A,B) ((A)>(B)?(A):(B))

I commented out where they define it the second time and all of the warnings went away after cleaning and building the project again.

Josh Valdivieso
  • 1,168
  • 1
  • 14
  • 22
2

Remove the MAX and MIN macro definitions from the sqlite3.c file, since they are already defined in system headers.

macbirdie
  • 16,086
  • 6
  • 47
  • 54
1

Issue Solution: Open Xcode project Build settings

add “-Wno-ambiguous-macro” into “Other C flags”