Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

File has one fewer "}" than "{", however all seem matched.

Therefore, it is probably in a comment.

How do I search within a comment or otherwise find the missing brace?

share|improve this question
What text editor are you using? – nmat Aug 17 '11 at 2:32

I would recommend using a text editor such as Notepad++ which gives you syntax highlighting and parenthesis matching. Navigate to each bracket/parenthesis/brace, and it will highlight the matching one. This will help you find the missing character.

share|improve this answer

A simple trick to find unbalanced braces and parentheses in C and C++ files is to run GNU indent across them.

Throw away the output and only look at the warnings and errors produced, they will show unbalanced braces and parentheses also in dead code.

To do this across a source tree I use it like

find . -name "*.[ch]*"|xargs -n1 indent -st >/dev/null
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.