Is there any opensource tool which can check the coding style use in C/C++ program.
What you probably want is a code beautifier. Run one of those against your code, and do a diff on the original versus the new.
indent is already there on most Linux boxes. Plus, it is freeware and is available for most other flavors of UNIX.
indent -prs -br -i 4 inputfile.c > temp
diff inputfile.c temp
sir it can be either tool or plugin which would say which coding style a program has like GNU Style or Allman style or Linux style etc..
$ whichstyle main.c
Output : Allman
I do not know of one that I personally have tried and such a thing exists it would be of limited use.
Some compilers will only accept K&R C (HPUX default C compiler), other may require an option to allow certain syntax standards (e.g. gcc -std=C90 )
It would be hard for an expert to determine a given "style" for most legacy production code - my opinion. Do not know of an IDE that can enforce a particular style, right out of the box, either.