2 Language Standards Supported by GCC

Determine the language standard. This option is currently only supported when compiling C. A value for this option must be provided; possible values are c89 iso9899:1990 ISO C89 (same as -ansi). Iso9899:199409 ISO C89 as modified in amendment 1. C99 c9x iso9899:1999 iso9899:199x ISO C99. While GCC 4.7 does have some C11 capabilities, it is severely lacking most of the features needed. So while the configure script uses the correct option to enable C11, the compiler can't actually handle the test-program because it uses features not available in the old GCC 4.7 version you have. Checking for x8664-pc-linux-gnu-gcc option to accept ISO C89. None needed checking whether x8664-pc-linux-gnu-gcc understands -c and -o together. Yes checking for style of include used by make.

For each language compiled by GCC for which there is a standard, GCCattempts to follow one or more versions of that standard, possiblywith some exceptions, and possibly with some extensions.

2.1 C Language

GCC supports three versions of the C standard, although support forthe most recent version is not yet complete.

The original ANSI C standard (X3.159-1989) was ratified in 1989 andpublished in 1990. This standard was ratified as an ISO standard(ISO/IEC 9899:1990) later in 1990. There were no technicaldifferences between these publications, although the sections of theANSI standard were renumbered and became clauses in the ISO standard. This standard, in both its forms, is commonly known as C89, oroccasionally as C90, from the dates of ratification. The ANSIstandard, but not the ISO standard, also came with a Rationaledocument. To select this standard in GCC, use one of the options-ansi, -std=c90 or -std=iso9899:1990; to obtainall the diagnostics required by the standard, you should also specify-pedantic (or -pedantic-errors if you want them to beerrors rather than warnings). See Options Controlling C Dialect.

Errors in the 1990 ISO C standard were corrected in two TechnicalCorrigenda published in 1994 and 1996. GCC does not support theuncorrected version.

An amendment to the 1990 standard was published in 1995. Thisamendment added digraphs and __STDC_VERSION__ to the language,but otherwise concerned the library. This amendment is commonly knownas AMD1; the amended standard is sometimes known as C94 orC95. To select this standard in GCC, use the option-std=iso9899:199409 (with, as for other standard versions,-pedantic to receive all required diagnostics).

A new edition of the ISO C standard was published in 1999 as ISO/IEC9899:1999, and is commonly known as C99. GCC has substantiallycomplete support for this standard version; seehttp://gcc.gnu.org/c99status.html for details. To select thisstandard, use -std=c99 or -std=iso9899:1999. (While indevelopment, drafts of this standard version were referred to asC9X.)

Errors in the 1999 ISO C standard were corrected in three TechnicalCorrigenda published in 2001, 2004 and 2007. GCC does not support theuncorrected version.

A fourth version of the C standard, known as C11, was publishedin 2011 as ISO/IEC 9899:2011. GCC has substantially complete supportfor this standard, enabled with -std=c11 or-std=iso9899:2011. (While in development, drafts of thisstandard version were referred to as C1X.)

By default, GCC provides some extensions to the C language that onrare occasions conflict with the C standard. See Extensions to the C Language Family. Use of the-std options listed above will disable these extensions wherethey conflict with the C standard version selected. You may alsoselect an extended version of the C language explicitly with-std=gnu90 (for C90 with GNU extensions), -std=gnu99(for C99 with GNU extensions) or -std=gnu11 (for C11 with GNUextensions). The default, if no C language dialect options are given,is -std=gnu11. Some features that are part of the C99 standardare accepted as extensions in C90 mode, and some features that are partof the C11 standard are accepted as extensions in C90 and C99 modes.

The ISO C standard defines (in clause 4) two classes of conformingimplementation. A conforming hosted implementation supports thewhole standard including all the library facilities; a conformingfreestanding implementation is only required to provide certainlibrary facilities: those in <float.h>, <limits.h>,<stdarg.h>, and <stddef.h>; since AMD1, also those in<iso646.h>; since C99, also those in <stdbool.h> and<stdint.h>; and since C11, also those in <stdalign.h>and <stdnoreturn.h>. In addition, complex types, added in C99, are notrequired for freestanding implementations. The standard also definestwo environments for programs, a freestanding environment,required of all implementations and which may not have libraryfacilities beyond those required of freestanding implementations,where the handling of program startup and termination areimplementation-defined, and a hosted environment, which is notrequired, in which all the library facilities are provided and startupis through a function int main (void) or int main (int,char *[]). An OS kernel would be a freestanding environment; aprogram using the facilities of an operating system would normally bein a hosted implementation.

GCC aims towards being usable as a conforming freestandingimplementation, or as the compiler for a conforming hostedimplementation. By default, it will act as the compiler for a hostedimplementation, defining __STDC_HOSTED__ as 1 andpresuming that when the names of ISO C functions are used, they havethe semantics defined in the standard. To make it act as a conformingfreestanding implementation for a freestanding environment, use theoption -ffreestanding; it will then define__STDC_HOSTED__ to 0 and not make assumptions about themeanings of function names from the standard library, with exceptionsnoted below. To build an OS kernel, you may well still need to makeyour own arrangements for linking and startup. See Options Controlling C Dialect.

GCC does not provide the library facilities required only of hostedimplementations, nor yet all the facilities required by C99 offreestanding implementations on all platforms; to use the facilities of a hostedenvironment, you will need to find them elsewhere (for example, in theGNU C library). See Standard Libraries.

Most of the compiler support routines used by GCC are present inlibgcc, but there are a few exceptions. GCC requires thefreestanding environment provide memcpy, memmove,memset and memcmp. Finally, if __builtin_trap is used, and the target doesnot implement the trap pattern, then GCC will emit a callto abort.

For references to Technical Corrigenda, Rationale documents andinformation concerning the history of C that is available online, seehttp://gcc.gnu.org/readings.html

2.2 C++ Language

GCC supports the original ISO C++ standard (1998) and containsexperimental support for the second ISO C++ standard (2011).

The original ISO C++ standard was published as the ISO standard (ISO/IEC14882:1998) and amended by a Technical Corrigenda published in 2003(ISO/IEC 14882:2003). These standards are referred to as C++98 andC++03, respectively. GCC implements the majority of C++98 (exportis a notable exception) and most of the changes in C++03. To selectthis standard in GCC, use one of the options -ansi,-std=c++98, or -std=c++03; to obtain all the diagnosticsrequired by the standard, you should also specify -pedantic (or-pedantic-errors if you want them to be errors rather thanwarnings).

A revised ISO C++ standard was published in 2011 as ISO/IEC14882:2011, and is referred to as C++11; before its publication it wascommonly referred to as C++0x. C++11 contains severalchanges to the C++ language, most of which have been implemented in anexperimental C++11 mode in GCC. For informationregarding the C++11 features available in the experimental C++11 mode,see http://gcc.gnu.org/projects/cxx0x.html. To select thisstandard in GCC, use the option -std=c++11; to obtain all thediagnostics required by the standard, you should also specify-pedantic (or -pedantic-errors if you want them tobe errors rather than warnings).

More information about the C++ standards is available on the ISO C++committee's web site at http://www.open-std.org/jtc1/sc22/wg21/.

By default, GCC provides some extensions to the C++ language; See Options Controlling C++ Dialect. Use of the-std option listed above will disable these extensions. Youmay also select an extended version of the C++ language explicitly with-std=gnu++98 (for C++98 with GNU extensions) or-std=gnu++11 (for C++11 with GNU extensions). The default, ifno C++ language dialect options are given, is -std=gnu++98.

2.3 Objective-C and Objective-C++ Languages

GCC supports “traditional” Objective-C (also known as “Objective-C1.0”) and contains support for the Objective-C exception andsynchronization syntax. It has also support for a number of“Objective-C 2.0” language extensions, including properties, fastenumeration (only for Objective-C), method attributes and the@optional and @required keywords in protocols. GCC supportsObjective-C++ and features available in Objective-C are also availablein Objective-C++.

Checking For Gcc-5 Option To Accept Iso C89 Unsupported Macos

GCC by default uses the GNU Objective-C runtime library, which is partof GCC and is not the same as the Apple/NeXT Objective-C runtimelibrary used on Apple systems. There are a number of differencesdocumented in this manual. The options -fgnu-runtime and-fnext-runtime allow you to switch between producing outputthat works with the GNU Objective-C runtime library and output thatworks with the Apple/NeXT Objective-C runtime library.

There is no formal written standard for Objective-C or Objective-C++. /how-to-fix-firefox-for-mac-catalina.html. The authoritative manual on traditional Objective-C (1.0) is“Object-Oriented Programming and the Objective-C Language”,available at a number of web sites:

  • http://www.gnustep.org/resources/documentation/ObjectivCBook.pdfis the original NeXTstep document;
  • http://objc.toodarkpark.netis the same document in another format;
  • http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/has an updated version but make sure you search for “Object Oriented Programming and the Objective-C Programming Language 1.0”,not documentation on the newer “Objective-C 2.0” language

The Objective-C exception and synchronization syntax (that is, thekeywords @try, @throw, @catch, @finally and @synchronized) issupported by GCC and is enabled with the option-fobjc-exceptions. The syntax is briefly documented in thismanual and in the Objective-C 2.0 manuals from Apple.

Checking For Gcc-5 Option To Accept Iso C89 Unsupported Macos Windows 10

The Objective-C 2.0 language extensions and features are automaticallyenabled; they include properties (via the @property, @synthesize and@dynamic keywords), fast enumeration (not available inObjective-C++), attributes for methods (such as deprecated, noreturn,sentinel, format), the unused attribute for method arguments, the@package keyword for instance variables and the @optional and@required keywords in protocols. You can disable all theseObjective-C 2.0 language extensions with the option-fobjc-std=objc1, which causes the compiler to recognize thesame Objective-C language syntax recognized by GCC 4.0, and to producean error if one of the new features is used.

GCC has currently no support for non-fragile instance variables.

The authoritative manual on Objective-C 2.0 is available from Apple:

For more information concerning the history of Objective-C that isavailable online, see http://gcc.gnu.org/readings.html

2.4 Go Language

As of the GCC 4.7.1 release, GCC supports the Go 1 language standard,described at http://golang.org/doc/go1.html.

2.5 References for Other Languages

See GNAT Reference Manual, for information on standardconformance and compatibility of the Ada compiler.

See Standards, for detailsof standards supported by GNU Fortran.

See Compatibility with the Java Platform,for details of compatibility between gcj and the Java Platform.

I am not sure if this is a cuda issue or a qmake/qtcreator config issue but here is the output.

I have tried the following:

  • changing the compiler in Tools>Options>Kits as in this screenshot.

    • I do get a warning saying

and likewise for G++ however as you can see it's just a different path. I actually went into the Qt mkspec files and changed it to gcc-5. I will go into detail about that next.

  • Changing the options in the Qt mkspec files.

    • I went into the 'linux-g++-64' and 'linux-g++' mkspec folders (liux-g++ is the one it said it uses by default but I manually set the kit to use linux-g++-64) and followed the included files and changed all the options to gcc-5 and g++-5 respectively. You can see that it worked in the warning above.
  • Changing options in my Project.pro file

    • I changed SuperRes.pro and here is the current contents.

I added -DCMAKE_CXX_COMPILER=/usr/bin/g++-5 and -DCMAKE_CXX_COMPILER=/usr/bin/gcc-5 wherever I could be it the NVCC flags or qmake options. I just put it wherever I could and it hasn't raised any extra warnings or errors so I can't imagine it's doing any harm but it's definitely not fixing the errors.

C89

NOTE:

I was trying this with GCC/G++ 6 when I had 7 enabled first then I tried gcc/g++ 5 because I thought maybe it meant anything above 6.0 so 6.4.0 would also be bad. Again i do not know exactly what the cause of this is. I know it's coming from cuda not being compatible with GCC but I don't know if qt-creator might be what is setting the GCC version here. Thanks for your time.

Checking For Gcc-5 Option To Accept Iso C89 Unsupported Macos Download

NOTE2:

Checking For Gcc-5 Option To Accept Iso C89 Unsupported Macos Software

I wasn't sure what part of the forum to post this in. I thought General and Desktop might be appropriate.