Skip to main content

+1 866 653-6233 LinkedIn Software Expert Witness Directory

About Us Contact Us

Barr Group Software Experts

Barr Group Software Experts

Main navigation

  • Expert Services
    • Consulting Experts in Software and Electronics
    • Expert Reports by Testifying Software Experts
    • Reverse Engineering and Forensic Analysis
    • Software Source Code Review and Analysis
  • Areas of Expertise
    • Left Side
      • Artificial Intelligence
      • Automotive Systems
      • Cloud Computing
      • Computer Security
      • Consumer Electronics
      • Electronic Circuits
      • Enterprise Software
      • Financial Technology
      • Firmware and IoT
    • Right Side
      • Industrial Controls
      • Mechanical Design
      • Medical Devices
      • Military & Aerospace
      • Mobile Devices & Apps
      • Optical Equipment
      • Renewable Energy
      • Signal Processing
      • Telecommunications
  • Matters & Venues
    • Patent Infringement and Invalidity Experts
    • Software Copyright and Trade Secrets Experts
    • Product Liability and Failure Analysis Experts
    • Contract Disputes and Software Project Failures
    • Venues and Clients
  • Directory
  • Case Studies
    • DirecTV Anti-Piracy
    • Samsung Software Copyright
    • Toyota Runaway Cars
  • Resources
    • Expert Witness Blog
    • Source Code Review in Litigation
    • Software Source Code Discovery

3.1 Spaces

  1. Home
  2. Embedded C Coding Standard
  3. 3 White Space Rules
  4. 3.1 Spaces

Rules:

3.1.a. Each of the keywords if, while, for, switch, and return shall be followed by one space when there is additional program text on the same line.

3.1.b. Each of the assignment operators =, +=, -=, *=, /=, %=, &=, |=, ^=, ~=, and !=shall always be preceded and followed by one space.

3.1.c. Each of the binary operators +, -, *, /, %, <, <=, >, >=, ==,!=, <<, >>, &, |, ^, &&, and || shall always be preceded and followed by one space.

3.1.d. Each of the unary operators +, -, ++, --, ! , and ~, shall be written without a space on the operand side.

3.1.e. The pointer operators * and & shall be written with white space on each side within declarations but otherwise without a space on the operand side.

3.1.f. The ? and : characters that comprise the ternary operator shall each always be preceded and followed by one space.

3.1.g. The structure pointer and structure member operators (-> and ., respectively) shall always be without surrounding spaces.

3.1.h. The left and right brackets of the array subscript operator ([ and ]) shall be without surrounding spaces, except as required by another white space rule.

3.1.i. Expressions within parentheses shall always have no spaces adjacent to the left and right parenthesis characters.

3.1.j. The left and right parentheses of the function call operator shall always be without surrounding spaces, except that the function declaration shall feature one space between the function name and the left parenthesis to allow that one particular mention of the function name to be easily located.

3.1.k. Except when at the end of a line, each comma separating function parameters shall always be followed by one space.

3.1.l. Each semicolon separating the elements of a statement shall always be followed by one space.

3.1.m. Each semicolon shall follow the statement it terminates without a preceding space.

Example: See Appendix D.

Reasoning: In source code, the placement of white space is as important as the placement of text. Good use of white space reduces eyestrain and increases the ability of programmers and reviewers of the code to spot potential bugs.

Enforcement: These rules shall be followed by programmers as they work as well as reinforced via a code beautifier, e.g., GNU Indent.

Book traversal links for 3.1 Spaces

  • ‹ 3 White Space Rules
  • Up
  • 3.2 Alignment ›

Request an Expert

(866) 653-6233

Barr Group logo
Call us

Expert Services

  • Source Code Review Services
  • Expert Witness Directory
  • Reverse Engineering Services
  • Expert Reports & Testimony
  • How-To Technical Articles
  • Engineering Services

Latest Insights

  • Payment Processing and e-Payments Fraud
  • Albert Einstein Expert Witness
  • Medical Device Litigation and FDA 510(k)
  • Personality Traits of the Best Expert Witnesses

Website contents copyright © 2012-2025 by Barr Group. | Barr Group's logo is a U.S.-registered ® trademark.

SITEMAP  |  PRIVACY