Subscribe by Email


Showing posts with label Compiler. Show all posts
Showing posts with label Compiler. Show all posts

Friday, June 22, 2012

How is optimization of smoke testing done?


Smoke testing being one of the quick and dirty software testing methodologies, needs to be optimized. This article focuses on the need of optimizing the smoke tests and how to optimize them. 

Let us first see the scenario behind the need for optimization of the smoke tests that are carried out on the software system or application. 
- In most cases of the development of software systems or applications, the code can be executed either directly from the command prompt or via a sub- routine of the larger software systems or applications. This is called the command prompt approach. 
- The code is designed in such a way that it has the qualities like self awareness as well as it is autonomous. 
- By the code being self aware, we mean that if anything goes wrong during the execution, the code should explain it. 
- Commonly two types of problems are encountered during testing and have been mentioned below:
  1. The path was compiled with too much of optimization and
  2. The data directory is not pointed out properly by the path.

Steps for Optimization of Smoke tests


- In order to confirm that the code was compiled correctly one should run the test suite properly at least once. 
- The first step towards optimization of the smoke test is to run it and then examine the output. 
- There are two possibilities that either the code will pass the test or it won’t. 
- If it is the second case then there are two possibilities that where your smoke test went wrong:
  1. Compiler bugs and errors or
  2. The path has not been set properly.

Compiler Bugs and Errors


Let us take up the first possibility, i.e., the compiler bugs and errors. 
-  It is probable that the correct code might not have been produced by the compiler. 
- In some cases of the serious compiler bugs, it is possible that there might be some hardware exception and these kinds of errors are caused mainly by the compiler bugs. 
- In this case the optimization level of the code should be minimized. 
- After this the code should be recompiled and observed again. 
- Optimizing is good for code but if it is of aggressive kind then it will definitely cause problems.

If path is not set properly


- It is obvious that if the code is not able to trace its data files then it will definitely show up some error and this happens because the path has not been set properly. 
- In such cases you need to check which path was it, fix it and recompile the whole code and execute once again.

When does a system or an application crash?


Don’t think that the software system or application crashes only when there has aggressive optimization of the code! 
- Crashes also happens with those programs in which there is no optimization of the code. 
But in such cases, only compiler errors can be blamed since it happens only if the compiler has not been set up properly on your system. 
- If no program executes, it means that your compiler is broken and you need to talk about this to your system administrator.

How to optimize smoke tests?


- A lot of help comes from MPGO (managed profile guided optimization). 
- The best way to optimize any kind of testing is to maintain a balance between the automated and manual testing.
- You need to run MPGO tool along with the necessary parameters for the test and then run the test. The test now will be optimized. 
- It is actually the internal binaries that are optimized either fully or partially. 
- Partially optimized binaries are deployed only in automated smoke testing. 


Friday, May 18, 2012

What is meant by pair programming?


With the advent of the agile software process development, so many agile software development methodologies also came in to the scene and one of them is the pair programming which has been discussed throughout this article. 

What is meant by Pair Programming?


- Pair programming is a commonly deployed agile software development process.
- It involves two software programmers or developers working together on a single work station. 
Out of the two programmers or developers one is called the driver and the other one is the observer. 
- The work of the driver is to type in the program code in to the compiler.
- The observer has to review the typed in code line by line for any discrepancy. 
- There is another quite familiar term for the observer which is the “navigator”. 
- At regular intervals of time, the two programmers or developers keep changing their roles. 
- While carrying out the review process, the observer also takes in to consideration the strategy that is being used for the work.
- Both the driver and the observer work for the improvement of the software system or application and try to identify all the potential problems that can take root in the future. 
- Most of the problems are addressed in the earlier stages of the development so that extra work burden is cropped up in the last and also to minimize the rewrite expenses.
- Such a methodology like pair programming helps the driver to concentrate only on the typing work.
- It does not focus up on each and every tactical aspect of the current task of the software system or the application under development. 
- Here we can say that the observer acts like a safety guide or net who tells the driver of the fault he makes while typing in the program code. 

Benefits of Pair Programming


Pair programming has got many benefits. A research was conducted regarding the benefits of the pair programming and it was found that:
- Following the pair programming, programs with shorter code length are produced. 
- These programs were found to possess better designs and lesser number of bugs as compared to the programs that are produced by individually working programmers. 
- Depending on the experience and skills of the programmers as well as the complexity of the task, the defects rates were found to get reduced surprising from range of 15 – 50 percent. 
- When two programmers work together, it is obvious that they will consider many design alternatives as compared to the programmers who work individually.
- This is so because the when two people think together, the scope of thinking widens and they arrive at simple and better working and maintainable designs, are able to catch defects early. 
- They are able to complete the programming work well within the stipulated period of time. 
- On the other hand the individually working programmer will take much longer time to complete the same task. 

Few drawbacks of Pair Programming


"An analysis conducted in the year of 2007 suggested that the pair programming is not wholly beneficial and effective since it identified many other factors that have large affects on the results of the programming tasks."
- It was observed that though the development time was reduced by the use of the pair programming and some marginal effects were induced, it required more developer effort! 
- Therefore if we see overall it tends to be more costly than the solo programming. 
- Though the coding of the programming took place at a faster pace but the time spent got doubled. - In some of the cases a drop in the productivity is observed while implementing the pair programming. 

Throughout the process of pair programming there is a knowledge flow between the two developers.


Sunday, December 11, 2011

What are different characteristics of compatibility testing?

First let us clear up with the concept of compatibility.

Compatibility of a software system or an application or any hardware system or components can be defined as the ability of that software system or hardware component to work efficiently with all the versions either newer or older of all CPU architecture designs and operating systems.

- Compatibility is one of the most important properties of any software system or application and hardware system.
- Not every where, every one uses the same CPU architecture designs and operating systems.
- Therefore, it becomes necessary to make software and hardware compatible will all sorts of systems available.
- Otherwise, the software or the hardware will remain confined to only one CPU architecture and operating system.
- There will be no benefit to the software and hardware developers who developed that software or hardware.

In other words, the software or the hardware product or artifact get promotion and hence it would not be widely accepted.
Keeping in view all these issues, care is taken to provide maximum compatibility to the software or the hardware system. Before its release to the open public, the software or the hardware product needs to undergo testing for determining its compatibility.
Such testing is called compatibility testing.

- Compatibility is categorized under non functional testings.
- Compatibility testing can be defined as the testing that is conducted on the software application or the hardware component to determine the concerned product’s compatibility with the computing technological environment.

A proper computing technological environment contains all of the below mentioned aspects:

- Bandwidth handling capacity: the environment should be able to handle bandwidth of the networking software and hardware.
- It should have a computing capacity of hardware platform like HP 9000 and IBM 360 etc.
- It should be compatible with all kinds of peripherals. In other words, it should have compatibility of peripherals. Peripherals include DVD drive, printers, monitors, speakers and so on.
- It should be compatible with all operating systems including UNIX, MVS, windows and so on.
- It should support all types of data bases like oracle, DB2, Sybase etc.
- It should be well compatible with other software systems like messaging tools, networking systems and web servers.
- It should be browser compatible. It should support all the available browsers till date like Netscape, internet explorer, Firefox, Google chrome, safari etc.

The above aspects together make up a proper and efficient computing environment to carry out compatibility testing for the software and hardware products.

Compatibility testing comprises many other small testings like peripheral compatibility testing, browser compatibility testing etc. browser compatibility testing is also known as user experience testing.
It involves the checking of web and network applications on all the available different browsers.

It is done to ensure the following:
- The application under testing should respond exactly in the same way with all the different browsers. It should exhibit same features and functionalities when run under different browsers.
- The visual experience for the users must be the same irrespective through which browser they are using the web application.
- The applications should be backwards compatible i.e., it should work with the older versions of the browser as well.
- The applications should be carrier compatible i.e., data transformation should be same no matter which carrier is being used. Some famous carriers include orange, sprint, Verizon, Airtel, O2 etc.
- Apart from software compatibility, the application should be hardware compatible.
- The applications should be compiler compatible i.e., there should be no difference in compilation by different compilers. All the compilers should compile the source code correctly.
- The applications should be able to run on emulators.


Wednesday, October 12, 2011

What makes one C compiler better than the other?

What makes C compiler better than the other? Well, that’s a question often debated upon. As we all know c is a general purpose programming language which was developed to run on UNIX operating system and till date it is the most widely used programming language being used to develop programs. it uses a weak compiler as compared to other language compilers.

The C compiler provides low level access to computer memory and offers programming constructs that are very easy to convert to machine level language. C compilers use minimum run time and they are very fats compilers though prone to errors. A C program can easily be converted to another language program with a minimum of rewriting. C compiler allows structured programming and is very flexible. Its static system avoids many of the errors that can happen during run time.
- C allows the executable code to be stored within functions.
- C compiler terminates a statement with a semicolon.
- C is basically a procedure oriented language.

There are many C compilers available in the market today and most them run on all operating systems including both windows and UNIX. Some of these c compilers are available as freeware, some are available under proprietary license, and some have BSD license and some other have GPL license. Many of the c compilers are not available online.

The best about C compilers is that a majority of them support “integrated development environment” or IDE which makes them more easy to use. Some C compilers apart from having IDE supporting feature come with some third party features which extend the functionality of the language and make it work faster. They provide better editing options and strong macros with great compiler integration and run time.

Most of these compilers take only 300 MB of space on your hard disk drive. For windows some are available in the size of 170 MB and so the installation process is not time consuming and does not checks your patience.

C compiler lets you use parallelism. Any source code before execution, needs to be converted into machine level language i.e., in the language that is easily understood by the CPU processor. C compiler does this effectively and very fast as compared to other language compilers available today.

C having a fast compiler is mostly used to write game codes. Since other languages are largely optimized, C is used widely even today. C compiler provides abstraction to a great degree. Compiling depends a lot on the length and complexity of the code and on the speed of the CPU processor. But, the C compiler compiles the required code in as less time as possible. C compiler being a very large and complex tool is very powerful and useful. C can be thought of as a portable assembly language and scripting of many other languages is based on C language only.

Learning all the features of C is a great deal. Many C compilers support all ANSI C standards. C compilers are so small that they can be directly used from a rescue disk. C compilers can produce x86 and x86- 64 code very fast. Many C compilers today come with an optional memory feature and a bound checker.

Few compilers can simultaneously compile and run the programs using the “command line” option. Under this feature programs run like shell scripts. The C compilers are exceptionally faster and better than any other compiler available today in terms of speed of compilation. C language is free of what is called bombastic jargon and it is not much optimized. Most of the C compilers like TCC produce codes in a single pass and each statement is compiled very carefully.


Tuesday, October 11, 2011

What are the problems of a C compiler?

Every programming language has some advantages and disadvantages which are not present in the other languages. Some languages are capable of solving some problems better as compared to other languages. But the point is that most of the problems have similar needs, requirements and logic, so the point where languages differ from each other is the efficiency with which they solve the problem.

Some provide more efficient and fluent solutions while others don’t. As we all know C is a basic programming language which was developed to solve problems and develop programs relating to kernels of the operating systems, compilers and graphical user interfaces. C compiler though being fast is not so efficient. It provides many downsides for a large number of problems. Many of us think that C is the fastest language but this is not true.

C++ compiles most of the C programs at the same speed as C++ does. Some of the features of C language like virtual function calls result in over heads. C is not object oriented. This in turn makes it more inconvenient to implement some programs. It is not able to force object orientation everywhere. C makes some programs that require object oriented programming more error prone. C has got a weak typing system as compared to other programming languages. This leads to many programming errors after compilation of the program.

A bigger standard library C++ allows the full use of the C standard library. This is very important of course, as the C standard library is an invaluable resource when writing real world programs.
- C++ has a library called the Standard Template Library.
- This standard library contains a number of templates that can be used while developing programs almost of any kind.
- It also includes many common data structures which are very useful like data lists, maps, data sets, etc. the standard library routines and its data structures are tailored to the specific needs of the programmer.
- Though standard library is no gold knife, still it does gives a great help in many programs for solving general purpose related problems. Many tasks like implementing a linked list in C take a lot of time.
- Though the compilation is fast but, who has got that much time to write those lengthy codes. That time you will feel the need for a better compiler which provides a shorter and effective code for implementing lists and other sorts of data structures in array form.

Even though C language was standardized long back in 1998, but till date we don’t have any good compilers for this language. It’s a very complex language and so requires a heavy compiler like itself to compile it. Another problem related to C compiling is that being a big and complex language, many few people have its correct knowledge of usage. A lot depends on the programmer also. If you are typing in the wrong code you are sure to get bad results.
Today also most of the programs are written in C. a need is felt to convert them to another programming language for better compilation. But the conversion is no good solution. Conversion of a C language program code is often ended up in rewriting almost the entire content of the program.

Programs written in C will always have 2 major problems. Firstly their code will be unusually lengthy and time consuming. Secondly, the program execution will be slower even though the compilation time is very less. The C program codes require more time to read, write and understand. C compiler being ineffective can crash any time. There’s a lack of high level routines in C compiler.


Thursday, October 6, 2011

Some details about Pointers in C...

There was a need for a kind of variable that could store the address of another variable, so that the value of he variable could be directly accessed through its memory address and could be manipulated more easily and in a short span of time. The “pointer” is such a variable invented. It can be defined as a variable which stores the address of another variable. A pointer can be declared easily as shown below:

int *ptr1;

The “int” keyword is used to tell compiler that the pointer “ptr1” will store the memory address of an integer type variable. The symbol “*” called asterisk is used to tell the compiler that the variable “ptr1” is actually a pointer and that it will store the address of the variable it is pointing to irrespective of the bytes it will require to store the memory address. The pointer “ptr1” is said to point to an integer variable. N the above declaration we didn’t provide ptr1 with a value i.e., it’s empty now. If the declaration is made outside the function, the pointer “ptr1” will be initialized to a value that will not point to any of the variables or objects in a C program. Pointers initialized in this manner are said to have a null value or are called as “null” pointers. Null pointers are very useful in many of the C programs as they prevent system crash. A null pointer is implemented using a macro. The macro used is called “NULL” macro. If you set the value of a pointer using the above mentioned macro through an assignment statement as shown below:

Ptr1 = NULL;

It is assured that the pointer is now having a null value or it has become a null pointer. A null pointer can be tested using the below given statement

if (ptr 1== NULL);

Now suppose we want to store the address of an integer a in the above declared pointer “ptr1”, we will use the following statement:

ptr1 = &a;

Before proceeding further, we should now that a pointer has two values attached to it. One is the “l value” and the other one is the “r value”. L value is where the address of the variable pointed to is stored. R value stores the value of that variable. Now, the function of the “&” operator is to retrieve this l value of the variable a. the assignment operator copies the address of the variable a to the pointer “ptr1”. Now the pointer “ptr1” is said to point to variable “a”.

The “*” operator is also called the dereferencing operator and is used for de-referencing as follows:

*ptr 1 = 10;

The above statement will copy the value “10” to the address of variable a pointed to by the pointer “ptr1”. The above assignment statement can be written in another way as shown below:

Printf ( “ % d \n ”, *ptr1 );

The above statement will also print the value stored in the pointer on the screen as output.

Pointers are very much essential nowadays in programs. They solve basically two problems avoiding many other problems that may follow. First problem that they solve is that they make it easy to share information and data through and from the different sections of the memory. Secondly, they solve the problem of having complex structures. They make it easy to have linked data structures namely linked lists and queues and also binary trees. Pointers reduce the complexity of the program and there are many things that one can do using only pointers. Pointers are by no doubt a powerful C construct.


Wednesday, September 14, 2011

Some details about pointers and strings in C...

There doesn’t exist anything in C like real strings. A string is an array. It can be defined as an array of characters. A string is terminated by a nul character “\0”. A string can be initialized normally as follows:

Char string[10];
String[0] = ‘c’;
String[1] = ‘a’;
String[2] = ‘t’;
String[3] = ‘s’;

Another way of initializing and declaring a string is as follows:
Char string[10] = “cats”;

The following statement asks compiler to allocate 10 bytes of memory for the string entered by the user. The string can store only 9 characters and the tenth one being used for “nul” character.

We can easily access strings and their constituent characters using character pointers. The string arrays are mostly used for storing char data type elements in the memory. The array of string pointers is preferred over two dimensional arrays of characters mainly for two reasons. The first reason is by implementing array of pointers, you can make more efficient use of available memory since it consumes lesser number of bytes for storing arrays of strings. The second main reason is that an array of string pointers makes the manipulation of strings easier. You can easily exchange the positions of strings in the array using pointers without touching their memory locations. This makes managing strings very convenient. Another way of initializing a string is by using pointers like

for example:
Char string[ ] = “cats”;
Char *a;

Here is a pointer pointing to the string “string”. Pointers are another suitable way to access string arrays and modify them as we want. Since strings are composed of characters, we should use pointers to characters. The types of the variable and the pointers must match otherwise an error will be generated. Be careful that you don’t use “&” (address of) operator to assign the address of a variable to the desired pointer. If you used it, the name of the array will be used as the address of that particular array. For this reason only we do not use “&” (address of) while passing a string to the function scanf(). For example see the following code:

Int a;
Char name[10];
Scanf(“%d%s”, &a, name);

The pointer allows us to access the required character in the string because we made it to point to that string. Functions can be passed to print labels and to call the function. Below is an example:

Void printlbl(char lbl[ ])
{
Printf (“the label: %s\n”, lbl);
}
int main()
{
char lbl2[] = "abc";

Printlbl(lbl2);

}

Now if we want to pass a pointer to the string array lbl2, we will use the following code:
Char *lblptr = lbl2;

The above declared pointer can be used in the function also like shown below:
Printlbl (lblptr) ;

After execution you will observe that both the statements give the same output. Now you will ask me why so? The answer for this is that when we pass an array as a parameter or an argument to a function, a pointer is automatically created without we knowing it and the arrays are passed by reference method automatically the way a pointer is passed. So the above written code can also be written the other way as follows:

void Printlbl(char *lbl)
{
printf("the Label: %s\n",lbl);
}
a code for dynamically allocated string is given below:
string = (char *)malloc(sizeof(char) * (len+1));

Some stings can be allocated dynamically. This is done when we don’t know how much long a string will go until the program is executed or when we don’t what size of string the user will enter.


Sunday, September 11, 2011

Why C compilers are better than other language Compilers?

A compiler as we all know is a program that translates source code into object code so that the code becomes executable, or we can say A compiler converts high level language code into a low level language code (assembly language).A compiler performs six major operations namely preprocessing, semantic analysis,lexical analysis, code generation, code optimization and parsing.

A compiler has basically 3 main parts. First is the front end that checks the semantics and syntax of the program and the errors are reported.Second, the middle end which does the optimization removing any unwanted or bad code.The last part is called the back end which translates the middle level intermediate representation or IR into the assembly language.

Processor registers are assigned. The back end also draws the schedule for the hardware units. Today we see a number of compilers available in the market like clang, Microsoft C, GCC, etc. C is still the favorite language of many programmers in the world. What makes it so special? It is its compiler. C compiler is better than any other language because it is small in size, so that you can execute a program everywhere. The C compiler is usually faster than any other language compiler. Furthermore there is no overhead byte code generated.

- You can use the dynamic C library directly.
- Most of the C compilers include memory and bound checker.
- Many C compilers are capable of running under windows XP and windows Vista and are also able to compile the command line.
- Most of them support integrated environment.
- C compilers are capable of handling multi- threaded programming and are good for exploiting dynamic parallelism which otherwise can make it difficult for passing messages.
- C compilers are algorithmic in nature and provide a scheduler to schedule the performance of the programs.
- They compile and link the codes very fast and they have a very powerful optimization technology.
- They come with a library source which is complete and brows able.
- They do extensive checking during the process of compilation.
- Some C compilers are safe from the risk of pointers and are capable of fast prototyping of the programs.
- They also don’t allow violation of array bonding.
- They can be run as interactive or non- interactive phases.
- They support enumerated data types, all data type variables like int, long, and float etc. some may also provide you with some sample programs to help you understand the features of the language.
- They are perfect for parallel computing. Global vectorization and optimization is also supported.
- These C compilers do inter procedural analysis. While doing optimization they give the user necessary feedback. They are able of transferring loops.
- C compilers are capable of code generation and give optimal performance from the processors.
- They simplify the execution thus, accelerating it. No limitations are imposed code size and optimization. They are very fast and accurate as compared to the compilers of other languages.
- Latest compilers are capable of building internet, distributed and windows applications. The code generation includes compiling, assembling, linking, resource compiling and adding library files.
- The integrated development includes editing, debugging, generating files and resource editing.
- They come with documentation and user’s manual.
- Most of the C compilers don’t come as freeware.
- C compilers require Windows 95 and other latest versions for implementing command lines.
- If a C compiler is supporting IDE, you need to have windows 2000 and following versions. The system should have a minimum of 32 MB of RAM and 500 MB of ROM.

We can say they are like many in one package which allow writing, developing, compiling, interpreting, assembling and debugging, and execution of the programs.


Thursday, September 8, 2011

How is program controlled in C?

Every program follows a control path. C program control constructs are conditionals and loops. Almost every program needs to go through some sort of decision making. Decision making processes are simulated in C using conditionals. We can state a conditional as a statement that instructs the compiler to execute a function or statement if a certain condition is proved true. Decision making is done on the basis of some logic. Logic is treated as arithmetic by C compiler. The value 0 stands for true and rest any other value stands for a false value. The most common conditionals are if-else statements, switch case statements and loops.

If-else statements are used for conditional branching. It starts with if followed by an expression in its parentheses. The enclosed expression is evaluated and if the condition proves out to be true the succeeding statement is executed. If the condition is false the succeeding statement is skipped. Break and continue statements are used in if else and switch case constructs. Break will cause the execution to jump out of the loop and execute the following immediate statements whereas continue statement causes the loop to execute again and again until the condition is proved false.

Switch case begins with keyword switch followed by a variable to be switched enclosed in a parentheses. The word case is used to begin each case followed by a variable for that case, then a colon and then by the statements to be executed. Statements will be executed until a break is found. Any of the above constructs can be nested. Now coming to the go to statement, with this goto statement you can jump in between anywhere in a program except you are not allowed to jump in a loop. Goto statements are mostly risky but if there’s a place in the program where a goto statement fits , feel free to use it. However you should not be used.

Let’s define the loops now. C has 3 types of loops namely the while loop, for loop and the do while loop. The “while loop” continues to execute till the condition proves to be false. It’s an entry controlled loop which means that the loop will execute only when the condition is met. In this loop the keyword while is followed by some expression in parentheses, followed by a compound statement enclosed in braces. After reaching at the end of the loop, the control goes back to the top and the condition is revaluated.

Do while loop is an exit controlled loop. The test condition is evaluated at the end only. So even if the condition is false the loop is executed once compared to the while loop which doesn’t allows execution even once if the condition is false. You can call the do while loop as a pos check loop. This is the main difference between the while loop and the do while loop. These loops can also be nested. Nesting is unlimited. The “for loop” is the easiest loop. All its loop controlled elements are gathered at one place while in other loops they are scattered everywhere in the program. In a for loop firstly the initialization expression is executed. Then, the test expression is evaluated. If it’s true, the body of the loop is executed. After the execution the update expression is implemented, the test expression is again evaluated. If it’s true the whole sequence is repeated. You should use a for loop hen you have to repeat a block of statements specific number of times. These are the tools that programs need to perform repetitive tasks and make decisions.


Tuesday, September 6, 2011

What are functions,variables and prototyping in C?

Variables or identifiers are the fundamental basic building blocks of a program. They are general terminology for objects, classes, functions, arrays etc. It can be defined as an arbitrarily long sequence of letters and digits and the first character must always be a letter. Upper and lower case letters are treated differently and all the characters are significant. C is implementation dependent. C is case sensitive as it treats lower and upper case letters differently. These are basically named storage, whose values can be manipulated during the execution of the program. There are 2 values associated with every variable namely r value and l value. The value of the variable is called r value whereas l value is the address in memory where the variable is located. Generally a variable is declared as :

type name;

A simple definition consists of a type specifier followed by a variable name. There are 2 types of variables: local variables and global variables. Local variables are declared inside a function and are available to that function only whereas global variable are declared outside main() and are available to all the functions.

A large program is difficult to manage and understand. Thus, it is broken down into different modules called functions which can be put together to form the complete program. So we can define a function as a sub program that acts on data and often returns a value. A good function contains a number of functions since it is easier to maintain update and debug. Each function has its own name. On the encounter of the function’s name in any part of the program the function is called. There are basically 2 types of functions namely built-in functions and user-defined functions. Built in functions are parts of the compiler package and are made available to the program by header files. For example: exit(), sqrt(), strlen(), size() etc. user defined functions are created by the programmer as per the requirements of the program. A function has 3 parts: function definition, function call and function prototype. In C a function must be defined before it is used anywhere. Generally a function is defined as:

type function-name(parameter list)
{
Body of the function
}

Here the type specifies the type of return value. The parameter list is the list of arguments passed to the function separated by commas. A function may be defined without any arguments or it can also have an open parameter. A function definition must have a return statement.

One of the most important features of C is function prototyping as it describes the function interface to the compiler. It can be defined as the declaration of the function that tells the program about the type of the value returned by the function and the number and type of arguments. Therefore, we can say that a prototype has following parts:
- Return type
- Name of the function
- Argument list

Function prototyping is essential as it allows a compiler to compare each use of the function with the prototype to determine whether the function has been invoked properly or not. This makes it easy for compiler to correct the errors. The function prototype and function definition must exactly agree on the function name, return type, and argument list. The prototype looks just like a function definition except that the code is missing. A prototype introduces a function to the program whereas a definition being a declaration also tells the program what the function is doing and how it is doing. C makes prototyping essential. We can skip the arguments in a prototype but not in the definition.


Sunday, September 4, 2011

What are C Compilers and their properties?

A compiler is a program that translates source code into object code. The compiler got its name from the way it works, checking the entire piece of source code and collecting and reorganizing the procedural instructions. Thus in this way a compiler differs from an interpreter which analyzes and executes each line of source code in succession, without looking at the entire program. Compilers require some time for producing an executable source code. However, programs produced by compilers execute much faster than the same programs executed by an interpreter. Many compilers are available for the same language. More than a dozen companies develop and sell compilers for C language. So here are some C compilers at your finger tips listed along with their properties:
1. AMPC: By Axiomatic Solutions Sdn Bhd. Supports all Operating systems. Proprietary license. not available online. Supports IDE.
2. Amsterdam Compiler Kit: By Andrew Tanenbaum and Cerial Jacobs. Works with UNIX and other OSs except windows. BSD license. Not available online. Does not support IDE.
3. Clang: By low level virtual kit. Supports all OSs. BSD license. Not available online. Does not support IDE.
4. Compiler: By Ninja Otter Inc. supports all OSs. Proprietary license. Available online. supports IDE.
5. DMS software reengineering Tool Kit: By semantic Designs. Supports all operating systems. Proprietary license. Not available online. Does not support IDE.
6. GCC: By GNU project. Supports all Oss. GPL license. Not available online. Doesn’t support IDE.
7. RCC (RCOR C compiler): By Rodrigo Caetano (rcor). Supports only windows and UNIX. GPL license. Not available online. Does not supports IDE.
8. Ideone: unknown author. Doesn’t support any OS. Freeware. available online. Does not support IDE.
9. Lab windows/ CVI: by National Instruments. All OSs. Proprietary license. Not available on web. Supports IDE.
10. Icc: By Chris Fraser and David Hanson. Supports all OSs. Freeware. Not available online. Supports IDE in windows only.
11. Mark Williams C: By Mark Williams Company. Supports all Oss except UNIX. Proprietary license. Not available online. Supports IDE.
12. Microsoft C: by Microsoft. Supports only windows. Proprietary license. Not available online. supports IDE.
13. Nwcc: By Nils Weller. Supports all OSs. BSD license. Not available online. Doesn’t support IDE.
14. Open64: By SGI Google, HP, and Intel, Nvidia, Path Scale, Tsinghua University and team. Supports all OSs. GPL license. Not available online. Doesn’t support IDE.
15. Pelles C: by Pelle Orinius. Supports only windows. Freeware. Unavailable on web. Supports IDE.
16. PGCC: By The Portland Group. Supports all OSs. proprietary license. Not found on web. Supports IDE.
17. Portable C compiler: By Anders Magnusson and team. Supports all OSs. BSD license. Not available online. Does not support IDE.
18. Power C: by Mix Software. Supports all Oss except windows and UNIX. Proprietary license. Doesn’t support IDE. Not available online.
19. QuickC: By Microsoft. Supports only windows. Proprietary license. Supports IDE. Not available online.
20. SAS/ C: Its author is SAS institute. Works with all Oss. Proprietary license. Supports IDE. Not available online.
21. Tiny C compiler: Its author is Fabrice Bellard. Supports only windows and UNIX. LGPL license. Doesn’t support IDE. Not available online.
22. Turbo C: By Embarcadero. Supports all Oss except windows and UNIX. Proprietary license. Supports IDE. Not available online.
23. CCS C compiler: By CCs, Inc. supports all OSs. Proprietary license. Supports IDE. Not available online.
24. Ups debugger: By Tom Hughes, Ian Edwards and team. Supports all Oss except windows. GPL license. Not available online. Supports IDE.
25. VBCC: by Dr. Volker Barthelmann. Supports all OSs. Doesn’t support IDE. Not available online.


Facebook activity