emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [GSoC] Org Merge Driver Update


From: Simon Thum
Subject: Re: [O] [GSoC] Org Merge Driver Update
Date: Sun, 26 Aug 2012 02:23:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120807 Thunderbird/10.0.6

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 via email to

[Prev in Thread] Current Thread [Next in Thread]