You would have to send a small example of code that shows a problem.

How do you think about the following messages?

elfring@Sonne:~/Projekte/Coccinelle/lokal/demos/pass-through> spatch -sp_file list_pass-through_candidates.cocci /usr/include/string.h -I /usr/include -I /usr/include/linux -recursive_includes -verbose_parsing -macro_file spatch-tweaks.h -c++ > list_pass-through_candidates.txt 2>list_pass-through_candidates-errors.txt

Beginning of the log file "list_pass-through_candidates-errors.txt":
init_defs_builtins: /usr/share/coccinelle/standard.h
init_defs: spatch-tweaks.h
remapping: __const to an ident in macro name
remapping: __restrict to an ident in macro name
HANDLING: /usr/include/string.h
ERROR-RECOV: found sync col 0 at line 44
parsing pass2: try again
ERROR-RECOV: found sync col 0 at line 44
parsing pass3: try again
ERROR-RECOV: found sync col 0 at line 44
parsing pass4: try again
ERROR-RECOV: found sync col 0 at line 44
parse error
 = File "/usr/include/string.h", line 32, column 0,  charpos = 1066
    around = '#define', whole content = #define __need_size_t
badcount: 16
bad: #include <features.h>
bad:
bad: __BEGIN_DECLS
bad:
bad: /* Get size_t and NULL from <stddef.h>.  */
BAD:!!!!! #define       __need_size_t
bad: #define    __need_NULL
bad: #include <stddef.h>
bad:
bad: /* Tell the caller that we provide correct C++ prototypes.  */
bad: #if defined __cplusplus && __GNUC_PREREQ (4, 4)
bad: # define __CORRECT_ISO_CPP_STRING_H_PROTO
bad: #endif
bad:
bad:
bad: __BEGIN_NAMESPACE_STD
bad: /* Copy N bytes of SRC to DEST.  */
ERROR-RECOV: found sync col 0 at line 49
parsing pass2: try again
ERROR-RECOV: found sync col 0 at line 49
parsing pass3: try again
ERROR-RECOV: found sync col 0 at line 49
parsing pass4: try again
ERROR-RECOV: found sync col 0 at line 57
parsing pass2: try again
ERROR-RECOV: found sync col 0 at line 65
parse error
 = File "/usr/include/string.h", line 57, column 0,  charpos = 1962
around = 'extern', whole content = extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
badcount: 14
bad:      __THROW __nonnull ((1, 2));
bad: __END_NAMESPACE_STD
bad:
bad: /* Copy no more than N bytes of SRC to DEST, stopping when C is found.
bad:    Return the position in DEST one byte past where C was copied,
bad:    or NULL if C was not found in the first N bytes of SRC.  */
bad: #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN
BAD:!!!!! extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
bad:                  int __c, size_t __n)
bad:      __THROW __nonnull ((1, 2));
bad: #endif /* SVID.  */
bad:
bad:
bad: __BEGIN_NAMESPACE_STD
bad: /* Set N bytes of S to C.  */
ERROR-RECOV: found sync col 0 at line 75
...


Does this example show any places where Coccinelle's C parser implementation would need further improvements?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to