Login | Register
My pages Projects Community openCollabNet

Discussions > issues > [Issue 16] Compile fails with clang: You have a sparse S_IFMT; second parameter of 'main' (argument array) must be of type 'char **'

fsvs
Discussion topic

Hide all messages in topic

All messages in topic

[Issue 16] Compile fails with clang: You have a sparse S_IFMT; second parameter of 'main' (argument array) must be of type 'char **'

Author pmarek
Full name P.Marek
Date 2012-07-14 08:32:54 PDT
Message http://fsvs.tigris.o​rg/issues/show_bug.c​gi?id=16






------- Additional comments from pmarek at tigris dot org Sat Jul 14 08:32:54 -0700 2012 -------
Thanks, that's the result of "just fixing, not looking" ;)

Cleaned up in r2463.

[Issue 16] Compile fails with clang: You have a sparse S_IFMT; second parameter of 'main' (argument array) must be of type 'char **'

Author ryandesign
Full name Ryan Schmidt
Date 2012-07-14 05:28:49 PDT
Message http://fsvs.tigris.o​rg/issues/show_bug.c​gi?id=16






------- Additional comments from ryandesign at tigris dot org Sat Jul 14 05:28:48 -0700 2012 -------
Thanks. While what you committed in r2462 works, it's not strictly speaking correct.

As it was before, the line in configure.in read:

int main(int argc, char *args[])

This is what you wanted to appear in configure, but autoconf processes square brackets specially, which
has the effect of removing them, leaving an invalid line in configure. You changed the line in configure.in
so it reads:

int main(int argc, char **args[])

autoconf will still remove the square brackets, leaving a valid line in configure.

The strictly speaking correct fix is to either remove the brackets from the line in configure.in entirely:

int main(int argc, char **args)

Or do what I did in the patch I attached and escape the brackets in configure.in by doubling them:

int main(int argc, char *args[[]])

[Issue 16] Compile fails with clang: You have a sparse S_IFMT; second parameter of 'main' (argument array) must be of type 'char **'

Author pmarek
Full name P.Marek
Date 2012-07-12 22:37:08 PDT
Message http://fsvs.tigris.o​rg/issues/show_bug.c​gi?id=16



User pmarek changed the following:

                What |Old value |New value
====================​====================​====================​====================​
                  Status|NEW |RESOLVED
--------------------​--------------------​--------------------​--------------------​
              Resolution| |FIXED
--------------------​--------------------​--------------------​--------------------​




------- Additional comments from pmarek at tigris dot org Thu Jul 12 22:37:08 -0700 2012 -------
Thanks a lot, r2462 (with an additional fix for copy+paste).

[Issue 16] Compile fails with clang: You have a sparse S_IFMT; second parameter of 'main' (argument array) must be of type 'char **'

Author ryandesign
Full name Ryan Schmidt
Date 2012-07-12 19:27:06 PDT
Message http://fsvs.tigris.o​rg/issues/show_bug.c​gi?id=16






------- Additional comments from ryandesign at tigris dot org Thu Jul 12 19:27:06 -0700 2012 -------
Created an attachment (id=10)
patch

[Issue 16] New - Compile fails with clang: You have a sparse S_IFMT; second parameter of 'main' (argument array) must be of type 'char **'

Author ryandesign
Full name Ryan Schmidt
Date 2012-07-12 19:26:33 PDT
Message http://fsvs.tigris.o​rg/issues/show_bug.c​gi?id=16
                 Issue #|16
                 Summary|Compile fails with clang: You have a sparse S_IFMT; se
                        |cond parameter of 'main' (argument array) must be of t
                        |ype 'char **'
               Component|fsvs
                 Version|current
                Platform|Linux
              OS/Version|All
                     URL|
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|core
             Assigned to|pmarek
             Reported by|ryandesign






------- Additional comments from ryandesign at tigris dot org Thu Jul 12 19:26:33 -0700 2012 -------
Compiling fsvs 1.2.5 on OS X Lion with clang fails with this message:

configure: error: in `/opt/local/var/macp​orts/build/_Volumes_​work_mports_dports_d​evel_fsvs/fsvs/work/​fsvs-1.2.5':
configure: error: You have a sparse S_IFMT. Please tell the dev@ mailing list.
See `config.log' for more details


Here is our automated build server's log of this:

http://build.macport​s.org/builders/build​ports-lion-x86_64/bu​ilds/2586/steps/comp​ile/logs/stdio


The config.log shows what the real problem is:

configure:4999: ccache /opt/local/bin/clang-mp-3.1 -o conftest -pipe -O2 -fnested-functions -arch x86_64 -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -idirafter /opt/local/include/apr-1 -
I/opt/local/include -L/opt/local/lib -arch x86_64 conftest.c -lgdbm -lsvn_ra-1 -lsvn_delta-1 -laprutil-1 -lpcre >&5
conftest.c:44:7: error: second parameter of 'main' (argument array) must be of type 'char **'
 int main(int argc, char *args)
     ^
1 error generated.


I'll attach a patch for configure.in that fixes this.
Messages per page: