emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Simon Thum <simon.thum@gmx.de>
To: Andrew Young <youngar17@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [GSoC] Org Merge Driver Update
Date: Sun, 26 Aug 2012 02:23:22 +0200	[thread overview]
Message-ID: <50396C7A.4080304@gmx.de> (raw)
In-Reply-To: <CAMvvmF80WXEU8qL6tqtj0pmoN5dG6fCBaKyBj3nYHwVetaB22A@mail.gmail.com>

Hi Andrew,

I finally got to code a bit and tried clang on the merge driver. BTW you 
should probably mention prerequisites like gcc 4.7.

clang suggests your syntax is C11/requires a c++-style ODR. Also there 
is one error and numerous warnings you might want to fix.

HTH,

Simon

clang -DHAVE_CONFIG_H -I. -I..    -O0 -I../gnulib/lib -g -O2 -MT oo 
`test -f 'org_heading.c' || echo './'`org_heading.c
In file included from org_heading.c:34:
In file included from ./doc_elt.h:28:
In file included from ./doc_elt_ops.h:29:
./doc_ref.h:54:3: warning: redefinition of typedef 'doc_ref' is a
} doc_ref;
   ^
./doc_ref.h:31:24: note: previous definition is here 

typedef struct doc_ref doc_ref;
                        ^
./doc_ref.h:203:37: warning: format specifies type 'int' but the 
argument has type 'doc_elt *' (aka 'st
       printf ("checking parent par=%d, ref=%d\n",
                                    ~^
./doc_ref.h:203:45: warning: format specifies type 'int' but the 
argument has type 'doc_elt *' (aka 'st
       printf ("checking parent par=%d, ref=%d\n",
                                            ~^
In file included from org_heading.c:34: 

In file included from ./doc_elt.h:28:
./doc_elt_ops.h:32:24: warning: redefinition of typedef 'doc_elt' is a 
C11 feature [-Wtypedef-redefinit
typedef struct doc_elt doc_elt;
                        ^
./doc_ref.h:29:24: note: previous definition is here 

typedef struct doc_elt doc_elt;
                        ^
In file included from org_heading.c:34: 

In file included from ./doc_elt.h:28:
./doc_elt_ops.h:34:27: warning: redefinition of typedef 'print_ctxt' is 
a C11 feature [-Wtypedef-redefinitio
typedef struct print_ctxt print_ctxt;
                           ^
./print_ctxt.h:69:3: note: previous definition is here 

} print_ctxt;
   ^
In file included from org_heading.c:34: 

In file included from ./doc_elt.h:28:
./doc_elt_ops.h:38:27: warning: redefinition of typedef 'merge_ctxt' is 
a C11 feature [-Wtypedef-redefinitio
typedef struct merge_ctxt merge_ctxt;
                           ^
./doc_ref.h:30:27: note: previous definition is here 

typedef struct merge_ctxt merge_ctxt;
                           ^
In file included from org_heading.c:34: 

In file included from ./doc_elt.h:28:
./doc_elt_ops.h:40:24: warning: redefinition of typedef 'doc_ref' is a 
C11 feature [-Wtypedef-redefinit
typedef struct doc_ref doc_ref;
                        ^
./doc_ref.h:54:3: note: previous definition is here 

} doc_ref;
   ^
In file included from org_heading.c:34: 

In file included from ./doc_elt.h:31:
./merge_ctxt.h:35:31: warning: redefinition of typedef 'gl_list_t' is a 
C11 feature [-Wtypedef-redefinition]
typedef struct gl_list_impl * gl_list_t;
                               ^
../gnulib/lib/gl_list.h:111:31: note: previous definition is here 

typedef struct gl_list_impl * gl_list_t;
                               ^
In file included from org_heading.c:34: 

In file included from ./doc_elt.h:31:
./merge_ctxt.h:45:3: warning: redefinition of typedef 'merge_ctxt' is a 
C11 feature [-Wtypedef-redefinition]
} merge_ctxt;
   ^
./doc_elt_ops.h:38:27: note: previous definition is here 

typedef struct merge_ctxt merge_ctxt;
                           ^
In file included from org_heading.c:34: 

In file included from ./doc_elt.h:33:
./parse_ctxt.h:30:31: warning: redefinition of typedef 'gl_list_t' is a 
C11 feature [-Wtypedef-redefinition]
typedef struct gl_list_impl * gl_list_t;
                               ^
./merge_ctxt.h:35:31: note: previous definition is here 

typedef struct gl_list_impl * gl_list_t;
                               ^
In file included from org_heading.c:34: 

./doc_elt.h:36:24: warning: redefinition of typedef 'smerger' is a C11 
feature [-Wtypedef-redefinition]
typedef struct smerger smerger;
                        ^
./merge_ctxt.h:38:24: note: previous definition is here 

typedef struct smerger smerger;
                        ^
In file included from org_heading.c:34: 

./doc_elt.h:51:3: warning: redefinition of typedef 'doc_elt' is a
} doc_elt;
   ^
./doc_elt_ops.h:32:24: note: previous definition is here 

typedef struct doc_elt doc_elt;
                        ^
In file included from org_heading.c:34: 

./doc_elt.h:57:3: warning: redefinition of typedef 'doc_key' is a
} doc_key;
   ^
./doc_elt_ops.h:36:24: note: previous definition is here 

typedef struct doc_key doc_key;
                        ^
In file included from org_heading.c:34: 

./doc_elt.h:153:1: warning: control reaches end of non-void functi
}
^
In file included from org_heading.c:36: 

./doc_elt_util.h:85:3: warning: redefinition of typedef 'substr' is a 
C11 feature [-Wtypedef-redefinitio
} substr;
   ^
./doc_elt_util.h:72:23: note: previous definition is here 

typedef struct substr substr;
                       ^
./doc_elt_util.h:109:37: warning: format specifies type 'int' but the 
argument has type 'size_t' (aka 'unsigned
   debug_msg (DOC_ELT, 5, "a.length=%d b.length=%d  ", a.length, b.
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                    %zd 

./debug.h:69:48: note: expanded from macro 'debug_msg' 

     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^
In file included from org_heading.c:36: 

./doc_elt_util.h:109:49: warning: format specifies type 'int' but the 
argument has type 'size_t' (aka 'unsigned
   debug_msg (DOC_ELT, 5, "a.length=%d b.length=%d  ", a.length, b.length);
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
                                                %zd 

./debug.h:69:48: note: expanded from macro 'debug_msg' 

     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^
In file included from org_heading.c:36: 

./doc_elt_util.h:128:10: warning: implicit declaration of function 
'stncmp' is invalid in C99 [-Wimplicit-funct
   return stncmp (substr.string, str, min_length);
          ^
./doc_elt_util.h:222:1: warning: control reaches end of non-void 
function [-Wreturn-type]
}
^
./doc_elt_util.h:230:1: warning: control reaches end of non-void 
function [-Wreturn-type]
}
^
In file included from org_heading.c:38: 

./org_heading.h:37:28: warning: redefinition of typedef 'doc_elt_ops' is 
a C11 feature [-Wtypedef-redefinition]
typedef struct doc_elt_ops doc_elt_ops;
                            ^
./doc_elt_ops.h:77:3: note: previous definition is here 

} doc_elt_ops;
   ^
In file included from org_heading.c:39: 

./org_text.h:30:25: warning: redefinition of typedef 'org_text' is a C11 
feature [-Wtypedef-redefinition
typedef struct org_text org_text;
                         ^
./org_heading.h:31:25: note: previous definition is here 

typedef struct org_text org_text;
                         ^
In file included from org_heading.c:39: 

./org_text.h:40:28: warning: redefinition of typedef 'doc_elt_ops' is a 
C11 feature [-Wtypedef-redefinition]
typedef struct doc_elt_ops doc_elt_ops;
                            ^
./org_heading.h:37:28: note: previous definition is here 

typedef struct doc_elt_ops doc_elt_ops;
                            ^
org_heading.c:127:3: warning: redefinition of typedef 'org_heading_data' 
is a C11 feature [-Wtypedef-redefinition]
} org_heading_data;
   ^
org_heading.c:44:33: note: previous definition is here 

typedef struct org_heading_data org_heading_data;
                                 ^
org_heading.c:139:3: warning: redefinition of typedef 'org_heading' is a 
C11 feature [-Wtypedef-redefinition]
} org_heading;
   ^
./org_heading.h:35:28: note: previous definition is here 

typedef struct org_heading org_heading;
                            ^
org_heading.c:149:3: warning: redefinition of typedef 'property' is a 
C11 feature [-Wtypedef-redefinition]
} property;
   ^
org_heading.c:79:25: note: previous definition is here 

typedef struct property property;
                         ^
org_heading.c:392:51: warning: format specifies type 'int' but the 
argument has type 'unsigned long' [-Wformat]
           debug_msg (DOC_ELT, 5, "Found first colon, at %d\n", ubound - i -
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
                                                         %ld 

./debug.h:69:48: note: expanded from macro 'debug_msg' 

     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^
org_heading.c:394:18: warning: using the result of an assignment as a 
condition without parentheses [-Wparentheses]
           if (foundtags = false)
               ~~~~~~~~~~^~~~~~~
org_heading.c:394:18: note: place parentheses around the assignment to 
silence this warning
           if (foundtags = false)
                         ^
               (                ) 

org_heading.c:394:18: note: use '==' to turn this assignment into an 
equality comparison
           if (foundtags = false)
                         ^
                         == 

org_heading.c:397:55: warning: format specifies type 'int' but the 
argument has type 'size_t' (aka 'unsigned long') [-Wformat]
               debug_msg (DOC_ELT, 5, "Setting  tags_ubound =%d\n", 
tags_ubound);
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
                                                             %zd 

./debug.h:69:48: note: expanded from macro 'debug_msg' 

     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^
org_heading.c:404:50: warning: format specifies type 'int' but the 
argument has type 'unsigned long' [-Wformat]
                   debug_msg (DOC_ELT, 5, "Found whitespace at %d, 
tagsfound=%d\n"
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
                                                               %ld 

./debug.h:69:48: note: expanded from macro 'debug_msg' 

     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^
org_heading.c:419:46: warning: format specifies type 'int' but the 
argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                              "tags_lbound = %d; tags_ubound = %d\n
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
                                             %zd 

./debug.h:69:48: note: expanded from macro 'debug_msg' 

     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^
org_heading.c:419:64: warning: format specifies type 'int' but the 
argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                              "tags_lbound = %d; tags_ubound = %d\n
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
                                                               %zd 

./debug.h:69:48: note: expanded from macro 'debug_msg' 

     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^
org_heading.c:426:30: warning: data argument not used by format string 
[-Wformat-extra-args]
                              tags_lbound, tags_ubound);
                              ^~~~~~~~~~~~~~~~~~~~~~~~~
./debug.h:70:46: note: expanded from macro 'debug_msg' 

       level, __FILE__, __LINE__, __func__, ##__VA_ARGS__);      \
                                              ^
org_heading.c:761:50: warning: using the result of an assignment as a 
condition without parentheses [-Wparentheses]
                   if (a_body.string[a_lookahead] = ']')
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
org_heading.c:761:50: note: place parentheses around the assignment to 
silence this warning
                   if (a_body.string[a_lookahead] = ']')
                                                  ^
                       (                               ) 

org_heading.c:761:50: note: use '==' to turn this assignment into an 
equality comparison
                   if (a_body.string[a_lookahead] = ']')
                                                  ^
                                                  == 

org_heading.c:856:50: warning: using the result of an assignment as a 
condition without parentheses [-Wparentheses]
                   if (b_body.string[b_lookahead] = ']')
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
org_heading.c:856:50: note: place parentheses around the assignment to 
silence this warning
                   if (b_body.string[b_lookahead] = ']')
                                                  ^
                       (                               ) 

org_heading.c:856:50: note: use '==' to turn this assignment into an 
equality comparison
                   if (b_body.string[b_lookahead] = ']')
                                                  ^
                                                  == 

org_heading.c:1535:44: warning: format specifies type 'int' but the 
argument has type 'size_t' (aka 'unsigned long') [-Wformat]
           debug_msg (ORG_HEADING, 5, "cur=%d, rel=%d \n", 
ctxt->current_level, level)
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                           %zd 

./debug.h:69:48: note: expanded from macro 'debug_msg'
     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^
org_heading.c:1668:70: warning: data argument not used by format string 
[-Wformat-extra-args]
   debug_msg (ORG_HEADING, 5, "level: %d", h->data[index]->rel_level, out);
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
./debug.h:70:46: note: expanded from macro 'debug_msg'
       level, __FILE__, __LINE__, __func__, ##__VA_ARGS__);      \
                                              ^
org_heading.c:1708:7: warning: implicit declaration of function 
'smerger_register_delete' is invalid in C99 
[-Wimplicit-function-declaration]
       smerger_register_delete (ctxt->global_smerger, ref, ctxt);
       ^
org_heading.c:1735:7: warning: implicit declaration of function 
'smerger_register_insert' is invalid in C99 
[-Wimplicit-function-declaration]
       smerger_register_insert (ctxt->global_smerger, ref, ctxt);
       ^
org_heading.c:1782:3: error: non-void function 'parse_tags' should 
return a value [-Wreturn-type]
   return;
   ^
org_heading.c:1900:43: warning: format specifies type 'int' but the 
argument has type 'unsigned long' [-Wformat]
       debug_msg (DOC_ELT, 5, "Generating %d long body_ws\n",
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
                                          %ld
./debug.h:69:48: note: expanded from macro 'debug_msg'
     fprintf (DEBUG_OUT, #module"-%d:%s:%d:%s " format,          \
                                                ^





On 08/18/2012 10:24 AM, Andrew Young wrote:
> It seems that a lot of my typedefs may not be valid c, but are
> accepted by newer versions of gcc and some other compilers. I only get
> a warning if I enable -pedantic using "gcc version 4.7.1 20120721
> (prerelease) (GCC)".
>
> I'm in the process of cleaning up my headers and should have something
> for you soon. In the meantime, I believe upgrading gcc should make the
> issue disappear. Let me know if I'm completely wrong :-)
>
>> HTH,
>>
>> Simon
>
> Thanks for trying out the merge driver. it's much appreciated.
>
> Sincerely,
> Andrew
>
>

      reply	other threads:[~2012-08-26  0:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 23:15 [GSoC] Org Merge Driver Update Andrew Young
2012-08-15 17:04 ` Eric Schulte
2012-08-15 19:22   ` Bastien
2012-08-15 20:15   ` Rasmus
2012-08-16 10:27   ` Andrew Young
2012-08-16 14:34     ` Eric Schulte
2012-08-18  2:09 ` Simon Thum
2012-08-18  8:24   ` Andrew Young
2012-08-26  0:23     ` Simon Thum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50396C7A.4080304@gmx.de \
    --to=simon.thum@gmx.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=youngar17@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).