- Aim:
- 1)To compile gcc version 4.5.0,
2)To detect simple 'if-else' statements after reading source code of gcc. - 3)Generate exception to handle 'if'.
4)Use git commands to point out difference made in newer compiled gcc from existing gcc on system.
3)Use of git commands using test.c file
[swati@localhost ~]$ mkdir repo
[swati@localhost ~]$ cd repo
[swati@localhost repo]$ cp /home/swati/test.c /home/swati/repo/
[swati@localhost repo]$ ls -l
total 4
-rw-rw-r--. 1 swati swati 61 2010-01-10 19:59 test.c
cp: Copy the file from home to the repository
[swati@localhost repo]$ git init
Initialized empty Git repository in /home/swati/repo/.git/
init: To initiliaze or re-initialize git repository
[swati@localhost repo]$ git add test.c
add: To add a new file to the index.
[swati@localhost repo]$ vi test.c
[swati@localhost repo]$ git commit
[master (root-commit) 9bb9f1e] make changes in test.c
1 files changed, 7 insertions(+), 0 deletions(-)
create mode 100644 test.c
commit:To store the current changes made to the file along with log messages.
[swati@localhost repo]$ git log
commit 9bb9f1e86dab976d215e38b65236be7d750908ff
Author: swatiraina
Date: Sun Jan 10 20:00:57 2010 +0530
make changes in test.c
added if stmt to test.c
log: To show the commit logs
[swati@localhost repo]$ git show
commit 9bb9f1e86dab976d215e38b65236be7d750908ff
Author: swatiraina
Date: Sun Jan 10 20:00:57 2010 +0530
make changes in test.c
added if stmt to test.c
diff --git a/test.c b/test.c
new file mode 100644
index 0000000..939db90
--- /dev/null // expected ---a/test.c
+++ b/test.c
@@ -0,0 +1,7 @@
+
+#include
+void main()
+{
+int a;
+printf("\nlinux");
+}
show: To display the differences between the original and new file
[swati@localhost repo]$ git diff /home/swati/test.c test.c
diff --git a/home/swati/test.c b/test.c
index 939db90..e7d7b33 100644
--- a/home/swati/test.c
+++ b/test.c
@@ -2,6 +2,7 @@
#include
void main()
{
-int a; //'-' to indicate deleted statements
+int a=10; //'+' to indicate committed statements
+if(a>10)
printf("\nlinux");
}
No comments:
Post a Comment