From 52a9ea9f5b5a47879c0b0a8eda7f5c5777913a52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Michel?= <francois.michel@uclouvain.be>
Date: Tue, 5 Feb 2019 16:04:19 +0100
Subject: [PATCH] Ex4: put the main function inside a separate function and
call it from main(). Reason: recent versions of gcc won't complain for the
return value of the main() function, even with -Wall.
---
Exercices/Programmes/prog-1.rst | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Exercices/Programmes/prog-1.rst b/Exercices/Programmes/prog-1.rst
index d263e8a..cf20bb9 100644
--- a/Exercices/Programmes/prog-1.rst
+++ b/Exercices/Programmes/prog-1.rst
@@ -78,12 +78,18 @@ que vous aviez réalisé en Java.
.. code-block:: c
- int main(int argc, const char *argv[])
+ int f()
{
int a = 1252;
printf("%d\n", a);
}
+ int main(int argc, const char *argv[])
+ {
+ f();
+ }
+
+
#. Expliquez à quoi sert l'option ``-Werror`` de ``gcc``. Regardez la manpage (`gcc(1)`_).
.. only:: staff
--
GitLab