summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <eric.schulte@gmx.com>2012-04-10 16:01:50 -0400
committerEric Schulte <eric.schulte@gmx.com>2012-04-10 16:01:54 -0400
commit6c1b38182b377c397c50f11bc86eca145d9cc5c2 (patch)
tree7baed38bd8c9dc5a9ec61c803317e0c602a3d3f6
parent9586c880b7dcb5b042d63e61f6460fb5b5bbb78b (diff)
downloadorg-mode-6c1b38182b377c397c50f11bc86eca145d9cc5c2.tar.gz
better wrapping of main C function
Thanks to Dov Grobgeld for pointing out this fix. * lisp/ob-C.el (org-babel-C-ensure-main-wrap): Add an explicit return to automatically generated main methods.
-rw-r--r--lisp/ob-C.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 5f6c1cb..583510a 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -152,7 +152,7 @@ it's header arguments."
"Wrap body in a \"main\" function call if none exists."
(if (string-match "^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*)" body)
body
- (format "int main() {\n%s\n}\n" body)))
+ (format "int main() {\n%s\nreturn(0);\n}\n" body)))
(defun org-babel-prep-session:C (session params)
"This function does nothing as C is a compiled language with no