Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

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

When I read about the LCC (Windows) compiler, I found out it has the implementation for operator overloading.

However, after a bit of Googling, I've confirmed that operator overloading isn't supported in standard C, although someone's comment mentioned LCC is ANSI-compliant.

Is LCC really standard C or is it just like objective-c, a C variant with object-oriented features?

share|improve this question
I think you're using lcc-win, which is based on lcc but they're two different compilers. As I recall, it has an option to disable extensions and conform to the C standard (C99, I think). – Keith Thompson Oct 1 '12 at 8:56

No, it's an extension. You're allowed to have extensions as long as they don't conflict with the standard.

share|improve this answer
Is objective-C an extension to original C?Is a language being considered as a new language(just like Objective-C) if it has added funationality(extension) to the language? – caramel1995 Sep 4 '12 at 15:46
Since all valid C programs are valid Objective C programs, it could be considered an extension. – Dirk Holsopple Sep 4 '12 at 15:52
So that's mean C++ is also a C variant since C code programs are valid C++ programs – caramel1995 Sep 4 '12 at 15:55
I think C++ and C standards conflict with each other now... – speeder Sep 4 '12 at 16:03
You're allowed to have extensions as long as they don't conflict with the standard -- True, but once you use the extensions, you're no longer C standard, unless the extensions are library-based (not compiler-based) and you can freely include the extension library in your own programs. – Robert Harvey Jan 31 '15 at 19:34

Many compilers claim to be compliant to some standard or another, and then enable their own private extensions by default. As long as you disable enough extensions, you can typically get a compiler into a mode that's "compliant" to some standard.

The only C functionality that's remotely close to overloading is limited type-generic macros of <tgmath.h> in C99 and generic selection expressions in C11 as outlined on this site.

share|improve this answer

C11 does not support operator overloading. Compilers may implement their own vendor-specific functionalities but those are not part of the C standard and as such they aren't standard compliant.

share|improve this answer

It is common for compilers to support a superset of a standard and describe themselves as compliant.

As long as they handle code which conforms to the standard as the standard says they should then they are conforming. Many compilers have a command line flag which can be turned on to treat code more strictly, rejecting code which makes use of non-standard features. I'd imagine LCC will have such a flag.

share|improve this answer
Welcome. Thanks for posting your first answer on Stack Exchange Programmers. – DeveloperDon Sep 30 '12 at 6:33
Actually, they must also issue a diagnostic on first use of any extension which breaks constraint making the program ill-formed. – Deduplicator Feb 1 '15 at 4:14

It looks to me like the LCC authors don't claim ANSI C compliance, but as you suggest in your question, have made their compiler support extensions to the C language.

"This document then, proposes the development of several enhancements to the language, mostly compatible with their C++ counterparts. The main aim is to make C programming easier, more secure and more flexible than it is now."

Operator overloading is definitely not part of ANSI C.

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.