Search This Blog

Wednesday, April 30, 2008

Web Tool to check any site status

Today, when I tried to commit some project code changes to SVN server (hosted on sourceforge.net) I got error. Then I tried to open sourceforge.net in a browser and it said “page cannot be displayed”. Ping and tracert also failed with request time out.

I knew sourceforge.net is down, but to make sure there is no problem with my network/proxy settings, I wanted somebody from outside my network to try and tell whether sourceforge.net is working for them or not. But unfortunately there is none of my friend was online at that time.

Found this site(http://downforeveryoneorjustme.com/) - which tries the given site and tells whether it is up or not. This is site contents too cool, just contains what you want. Without this site, it is little harder to find whether the problem is with local network or actually the site is down.

Wednesday, April 16, 2008

Leading underscores in C

C compilers were prepending an underscore to all the symbols (function, variable names). I read from somewhere this is to avoid name collision with other language libraries. This convention was started with UNIX. When UNIX was written in C to use the existing assembly libraries, C symbols were added with a leading underscore by compilers and linkers.

Currently there is no need for this unless otherwise if you want to use old library. So most of the new C compilers are not adding leading underscores; however it also depends on the platform and object file. For example, Linux a.out GCC does such prepending, while Linux ELF GCC does not.

To explicitly tell the GCC compiler to not to use leading underscore you can use –fno-leading-underscore option.

Note: FORTRAN was adding both leading and trailing underscores to avoid name collision to avoid naming collision with C.