Entries Tagged as 'c programming'
GCC and Linux are a great pair. Although they are independent pieces of software, Linux is totally dependent on GCC to enable it on new architectures. Linux further exploits features in GCC, called extensions, for greater functionality and optimization.
Read this article from IBM Developer Works to find out more…
Sphere: Related Content
[Read more →]
Tags:
inotify is a Linux kernel subsystem which monitors Linux file system operations, such as read, write, create and delete. It was included in the mainline kernel from release 2.6.13 (June 18, 2005). It is more efficient than busy polling from a corn job and it’s an extensions to Linux file system to capture the file [...]
[Read more →]
Tags:
This weekend I am doing simple project to display twitter time line on ‘Conky’ widget. For that first I need to write a simple program which will print the twitter time line of my friends. First I tried to use python-twiiter API and failed due to strange Python error. After that I started to implement [...]
[Read more →]
Tags:
I got very positive response for my previous post that published test results of Recursion algorithm efficiency testing.
Bluestorm and Alex has responsed to above post asking me to try gcc -O2 optimization level. I tried -O2 optimization and here is the results for factorial of 5 using different factorial algorithm implementations:
Here is the results for [...]
[Read more →]
Tags:
Because of the responses I got from readers for previous post ‘Efficiency of Algorithms: Recursive vs Non-Recursive’, I did some test using RDTSC instruction available in Pentium class CPUs. I measure time taken to execute factorial function implemented in different ways 10000000 times. Factorial function is implemented in non-recursive, recusive and tail-recursive manner(Tail recursive version [...]
[Read more →]
Tags:
Static Functions
Static functions are functions that are only visible to functions in the same file and they are not callable from outside. Static functions are used when we only need to call them within the single source file they are defined in. This make static functions are usable when we need to hide internal details [...]
[Read more →]
Tags:
These are some ideas from people who replied to this discussion.
Rishi:
Its safer to use memmove if you are not sure about the overlapping of source buffer and destination buffer. This make memmove little bit slower than memcpy which blindly copies the src into dest and will probably get nuked if they overlap. Its smarter cousin [...]
[Read more →]
Tags:
As they have mentioned in this document, there can be errors in code that work well with previous versions of GCC. They have mentioned that, new warnings may exist for previously warning-free code that uses -Wuninitialized, -Wstrict-aliasing,-Wunused-function, -Wunused-variable (-Wall subsumes many of these warning flags). And when we use -Wall in conjuction with -Werror it [...]
[Read more →]
Tags: