{"thread":{"id":"35750","subject":"[PATCH] Makefile: add cppcheck target","startedAt":"2014-01-29T11:02:51Z","lastAt":"2014-01-29T18:26:29Z","messageCount":2,"participants":["Elia Pinto","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"233883","messageId":"1390993371-2431-1-git-send-email-gitter.spiros@gmail.com","threadId":"35750","inReplyTo":null,"subject":"[PATCH] Makefile: add cppcheck target","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-01-29T11:02:51Z","receivedAt":"2014-01-29T11:02:51Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Add cppcheck target to Makefile. Cppcheck is a static\nanalysis tool for C/C++ code. Cppcheck primarily detects\nthe types of bugs that the compilers normally do not detect.\nIt is an useful target for doing QA analysis.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n Makefile      |    6 ++++++\n config.mak.in |    1 +\n 2 files changed, 7 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex dddaf4f..1d25a70 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2602,3 +2602,9 @@ cover_db: coverage-report\n cover_db_html: cover_db\n \tcover -report html -outputdir cover_db_html cover_db\n \n+### cppcheck static coverage analysis\n+#\n+.PHONY: cppcheck\n+\n+cppcheck:\n+\tcppcheck --enable=all -q $(top_srcdir)\ndiff --git a/config.mak.in b/config.mak.in\nindex e6a6d0f..86b95fb 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -22,3 +22,4 @@ docdir = @docdir@\n \n mandir = @mandir@\n htmldir = @htmldir@\n+top_srcdir = @top_srcdir@\n-- \n1.7.10.4\n"},{"id":"233895","messageId":"xmqqeh3qk5ka.fsf@gitster.dls.corp.google.com","threadId":"35750","inReplyTo":"1390993371-2431-1-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH] Makefile: add cppcheck target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-29T18:26:29Z","receivedAt":"2014-01-29T18:26:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elia Pinto <gitter.spiros@gmail.com> writes:\n\n> Add cppcheck target to Makefile. Cppcheck is a static\n> analysis tool for C/C++ code. Cppcheck primarily detects\n> the types of bugs that the compilers normally do not detect.\n> It is an useful target for doing QA analysis.\n>\n> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n> ---\n>  Makefile      |    6 ++++++\n>  config.mak.in |    1 +\n>  2 files changed, 7 insertions(+)\n>\n> diff --git a/Makefile b/Makefile\n> index dddaf4f..1d25a70 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2602,3 +2602,9 @@ cover_db: coverage-report\n>  cover_db_html: cover_db\n>  \tcover -report html -outputdir cover_db_html cover_db\n>  \n> +### cppcheck static coverage analysis\n> +#\n> +.PHONY: cppcheck\n> +\n> +cppcheck:\n> +\tcppcheck --enable=all -q $(top_srcdir)\n\nWhy isn't this \".\"?\n\nIn other words, why is the change to config.mak.in even necessary?\n\n> diff --git a/config.mak.in b/config.mak.in\n> index e6a6d0f..86b95fb 100644\n> --- a/config.mak.in\n> +++ b/config.mak.in\n> @@ -22,3 +22,4 @@ docdir = @docdir@\n>  \n>  mandir = @mandir@\n>  htmldir = @htmldir@\n> +top_srcdir = @top_srcdir@\n"}]}