Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1000691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:33:14+00:00 2026-05-16T07:33:14+00:00

I currently do the following and the compiler (MSVC2008 / as well as 2010)

  • 0

I currently do the following and the compiler (MSVC2008 / as well as 2010) doesn’t complain about it but I’m not sure if it’s a bad idea or not:

#ifndef FOO_H_
#define FOO_H_

// note, FOO_H_ is not a comment:
#endif FOO_H_

I used to always write it as #endif // FOO_H_ but I caught myself not doing that today and thought it was strange because apparently I’ve not done the comment method for a while.

Is this bad practice that I should go back through all of my headers and fix (it’s a cross-platform application) or is it okay to leave it the way it is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:33:15+00:00Added an answer on May 16, 2026 at 7:33 am

    Strictly speaking (according to the grammar in the standard) no tokens are allowed following the #endif directive on the same line (comments are OK since they get removed at an earlier phase of translation than the preprocessing directives – phase 3 vs. 4).

    However, MSVC seems to allow it – I wouldn’t go on a quest to fix these (since they aren’t causing a problem), but would probably make a mental note to fix them as you modify the headers that have them.

    Of course, if your other supported compilers issue diagnostics about them it’s probably more urgent to fix them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently having following error message when executing a .sql file with about 26MB
I'm currently creating a CMS system and found that the following doesn't work. I
I'm currently investigating the possibility to force the rvct compiler not to link in
I am currently writing a C (not C++). It seems the Microsoft's C compiler
I'm currently following the third tutorial listed here: here where I'm trying to compile
The following source code compiles correctly with Visual Studio 2010: namespace NS { class
Currently following is the setup of my wifi connection. Laptop 1 ------> Wifi Router
I'm currently following: http://railsontherun.com/2007/10/04/sexy-charts-in-less-than-5-minutes/ I went through it all pretty easily, but then when
I'm currently following a tutorial in a book, and it instructs to create a
I'm starting to use Role Management in my website, and I'm currently following this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.