How are variable arguments implemented in gcc?

If you look at the way the C language stores the parameters on the stack, the way the macros work should become clear:- Higher memory address Last parameter Penultimate parameter …. Second parameter Lower memory address First parameter StackPointer -> Return address (note, depending on the hardware the stack pointer maybe one line down and … Read more

What does CC?= in a Makefile mean?

From http://www.gnu.org/software/make/manual/make.html: There is another assignment operator for variables, `?=’. This is called a conditional variable assignment operator, because it only has an effect if the variable is not yet defined. This statement: FOO ?= bar is exactly equivalent to this (see The origin Function): ifeq ($(origin FOO), undefined) FOO = bar endif Probably CC … Read more

C++: When (and how) are C++ Global Static Constructors Called?

When talking about non-local static objects there are not many guarantees. As you already know (and it’s also been mentioned here), it should not write code that depends on that. The static initialization order fiasco… Static objects goes through a two-phase initialization: static initialization and dynamic initialization. The former happens first and performs zero-initialization or … Read more

out of memory issue in installing packages on Ubuntu server

Extend your RAM by adding a swap file: http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/ a swap file is a file stored on the computer hard drive that is used as a temporary location to store information that is not currently being used by the computer RAM. By using a swap file a computer has the ability to use more memory … Read more