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 8185029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:42:19+00:00 2026-06-07T01:42:19+00:00

I was recently reading Stroustrups The C++ Programming Language and in the section about

  • 0

I was recently reading Stroustrups The C++ Programming Language and in the section about Linkage in chapter 9 I came across the following paragraph:

“In C and older C++ programs, the keyword static is (confusingly) used
to mean “use internal linkage”. Don’t use static except inside functions
and classes.”

The problem is that reading further on, the author did not elaborate on why this is bad practice. I use static functions from time to time in my code usually for some simple calculation that is not needed outside the compilation unit, but I never realised this was frowned upon and it is not obvious to me why it is bad. Can anyone shed light on this for me please??

  • 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-06-07T01:42:21+00:00Added an answer on June 7, 2026 at 1:42 am

    I think that the idea is not to frown upon internal linkage, but to avoid confusion with the new meaning of static: static has way too many meanings (declaring stuff with internal linkage, defining local variables with static storage duration, marking non-instance members of classes), so avoiding one of the less intuitive ones is a good thing.

    Because of this, the C++98 standard provides another way to declare stuff with internal linkage: unnamed namespaces, and deprecates static “when declaring objects in a namespace scope”.

    The C++11 standard removed this deprecation (and also changed somehow the semantic of unnamed namespaces, not really requiring internal linkage), so it’s now really a matter of style.

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

Sidebar

Related Questions

Recently, I was reading 2 books and I came across with the following statements
I was recently reading about artificial life and came across the statement, Conway’s Game
I did quite a reading about Android recently and I came across something that
Recently i'm reading the book Operating System Concepts Chapter VI about critical section problem,
I have recently been reading up on the D programming language, and am interested
I recently came across the subject of exact real arithmetic after reading this paper
I recently bought Programming Scala , and have been reading through it. The language
I was recently reading a book as prep for an interview and came across
I was recently reading a few articles on PHP Object oriented programming and came
I was recently reading an article in the bitsquid blog about how to manage

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.