Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Square-bracket syntax for array arguments to functions not handled #98

Open
eternaleye opened this issue Dec 10, 2016 · 1 comment
Open

Comments

@eternaleye
Copy link

While compiling lmdb:

<command-line>:0:1: warning: undefining "__LINE__"
("mtest.c": line 24): Corrode doesn't handle this yet:
    * argv[]

The following change to the C source fixes the issue:

diff --git a/libraries/liblmdb/mtest.c b/libraries/liblmdb/mtest.c
index 28a33d443299..067dfbe27467 100644
--- a/libraries/liblmdb/mtest.c
+++ b/libraries/liblmdb/mtest.c
@@ -21,7 +21,7 @@
 #define CHECK(test, msg) ((test) ? (void)0 : ((void)fprintf(stderr, \
        "%s:%d: %s: %s\n", __FILE__, __LINE__, msg, mdb_strerror(rc)), abort()))

-int main(int argc,char * argv[])
+int main(int argc,char ** argv)
 {
        int i = 0, j = 0, rc;
        MDB_env *env;

This might be a good entry-level fix for a new contributor

@Gaelan
Copy link

Gaelan commented Jan 12, 2017

Make uses the following program to test the C compiler, making corrode unusable for any CMake-compiled code:

#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif
#if defined(__CLASSIC_C__)
int main(argc, argv)
  int argc;
  char* argv[];
#else
int main(int argc, char* argv[])
#endif
{ (void)argv; return argc-1;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants