Coding Style checking


 
Thread Tools Search this Thread
Top Forums Programming Coding Style checking
# 1  
Old 04-30-2014
Coding Style checking

Is there any opensource tool which can check the coding style use in C/C++ program.
# 2  
Old 04-30-2014
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.

Code:
indent -prs -br -i 4 inputfile.c > temp
diff inputfile.c temp

# 3  
Old 05-02-2014
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
# 4  
Old 05-08-2014
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. What is on Your Mind?

Coding Style at UNIX.com forums

Hi, as I mentioned in this thread(https://www.unix.com/shell-programming-and-scripting/280737-awk-function-return-permutations-n-items-out-m.html), a helpful coding style may improve overall value and support for people who come here and want to learn things the participants from unix.com have... (2 Replies)
Discussion started by: stomp
2 Replies

2. Shell Programming and Scripting

Programming guidelines and style

Hello all, I would like to know if there is a generally accepted unix shell programming Guideline? Do you have any idea where to find this? There are a lot of programming Guidelines to find over Google, but is there one who is generally accepted? (3 Replies)
Discussion started by: API
3 Replies

3. What is on Your Mind?

Old Style Computing and Networking

Does any one know what uucp stands for, what gopher is, does any one go BBS and edit with ed? If yes, are there any uucp providers today? Sometimes i get bored by all the Web @@@@ , and feel lonely in the world without uucp and free (realy free - no stupid Spamhaus etc) mailing lists. TIA Action (14 Replies)
Discussion started by: Action
14 Replies

4. Solaris

CDE Style Manager

How would one go about adding or removing the applications (keyboard, mouse, beep, screen, etc) from CDE's style manager (/usr/dt/bin/dtstyle)? running solaris 5.10 (4 Replies)
Discussion started by: eddiet
4 Replies

5. AIX

Dashboard style tool(s)?

I was wondering if anyone knows of any dashboard style tools for AIX. One of my many responsibilities is to report the status of the boxes and whether certain things are "up" and running each and every day. Nonetheless, this is a MAJOR pain as I have to logon to each box, pull up URLs through my... (3 Replies)
Discussion started by: dsimpg1
3 Replies

6. Post Here to Contact Site Administrators and Moderators

New Style

Hi, I pop in here every so oftern and was suprised to see the changes in colour. I think the new style/colour is great :D (1 Reply)
Discussion started by: Ralf
1 Replies

7. Post Here to Contact Site Administrators and Moderators

Style not working right

:( The style "Craig's InfoPop" doesn't wrap lines on Netscape 4.79. It seems to work okay on MSIE. When I get home, I'll check on FBSD/Mozilla 1.0. Back to Silk Road ... (3 Replies)
Discussion started by: criglerj
3 Replies
Login or Register to Ask a Question