top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Step by step compilation of C Program

0 votes
42 views

Recently I was dealing with some problems in Compiler design. What I want is a tool which can do step by step compilation of the C Program. One which performs lexical analysis and gives an output file and then syntax analysis on this output file and so on until the final executable code is obtained. Is there such a tool or technique to do this?

posted Mar 22, 2013 by Salil Agrawal

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

0 votes

Since the intermediaries are compiler specific, it really depends on
which compiler.

Certainly most tend to be able to give you the output after the
pre-processor, and IIRC the assembly code but not sure about the
others.

Usually you need a command line option; for example in gcc to get the
preprocessor output, I usually stick the following in my Makefiles:

%.pp: %.c
$(CC) $(CFLAGS) -E -c $(@:.pp=.c) > $@

answer Mar 22, 2013 by anonymous
0 votes
answer Mar 22, 2013 by anonymous
Similar Questions
+3 votes

I am newbie to C and getting the compilation error in the following function.

int get_names(int students, char names[students][20])
{
        int i;
        for (i = 0; i < students; ++i)
        {
                printf("Enter name for Student %d: ", i);
                scanf("%s", names[i]);
        }
        return char names[students];
}

Error:

return char names[students];
error: expected expression before 'char'
0 votes

I have a requirement in my project which requires a very high throughput. I need to choose a programming language for this project. Want to know the opinion if the people which language to select keeping the fact that development should be fast and throughput is not compromised.

+5 votes

I have few queries about inline function, can anyone please help?

  1. In what stage of compilation inline function is replaced with function call?
  2. Under what conditions inline function will fail?
  3. How to verify whether inline function is successfully replaced or not?

Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...