Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qualifiers, modifiers, specifiers

Tags:

c

standards

So I have come across following definition in one of Wikipedia articles (rough translation):

Modifier (programming) - element of source code being a phrase of given programming language construct, which results in changed behavior of given construct.

Then, the article mentions modifiers in regard to ANSI C standard:

type modifiers (sign - signed unsigned, constness const, volatility volatile)

Then it also mentions the term in regard to languages such as Turbo C, Borland, Perl, but given there is no mention of modifier in ANSI/ISO 9899, this already puts validity of article into doubt.

Answers to this question draw similar conclusions.

However, when looking at some of the top searches on google, you get the term modifier mentioned everywhere around in tutorial sections, or even example interview questions.

So the question is: Can the usage of the term modifier in this context be justified or rather requires correction when mentioned?

like image 900
thorhunter Avatar asked Sep 14 '26 16:09

thorhunter


1 Answers

Can the usage of the term modifier in this context be justified or rather requires correction when mentioned?

The C spec does not use "modifier" with a specific definition. It does discuss how things are modifiable, etc. and details the term modifiable lvalue, but nothing that ties to OP's concerns about signed, unsigned, const, volatile.

In C, const, volatile, and restrict are type-qualifiers.

signed, unsigned are 2 of the standard integer types.

So the authoritative reference is silent on "usage of the term modifier".


Lacking a standard reference answer, it does make sense, when using the term modifier, to justify its context to avoid quibbling corrections.

Like many terms that span multiple languages, the reader needs to understand the terms are used loosely when applied so broadly. Each computer language has and needs very precise terms. When speaking C, best to avoid the term unless a generality is needed in context with other languages.

like image 171
chux - Reinstate Monica Avatar answered Sep 17 '26 06:09

chux - Reinstate Monica



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!