Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
GCC_Support
GCC_Support
General GCC Support Notes

C/C++test supports the following distributions of the GCC compiler:

...

To use any of these supported distributions, the directory containing the GCC executable must be included in the $PATH environment variable.

...

Tip

...

.

Unsupported Compiler Extensions for GCC Compilers

...

GCC 2.95.x

Unsupported Features

  • Arrays of Variable Length as Arguments to Functions

    Code Block
    void tester (int len, char data[len][len])
    {
    }

    Complex Numbers

  • Nested Functions
  • Named Return Values
  • Virtual Functions With Overridden Return Types

    Code Block
    class A
    {
    	public:
    		virtual void* a();
    };
    class B:
    	public A
    {
    	public:
    		virtual B* a(); // Return type changed from void* to
    			(compatible) B*.
    };

Incompatibilities

  • Function Attributes

    Code Block
    void fatal () __attribute__ ((noreturn));
    void fatal () { }
    typedef void voidfn ();
    volatile voidfn fatal;
      "void fatal()"
  • Member Access Checking

    Code Block
    class A
    {
    	public:
    		void pub_func();
    	protected:
    		void prot_func();
    };
    class B : public A
    {
    	public:
    		void foo()
    		{
    			&A::prot_func;
    		}
    };

GCC 3.2.x

Unsupported Features

  • Arrays of Variable Length as Arguments to Functions

    Code Block
    void tester (int len, char data[len][len])
    {
    }
  • Complex Numbers
  • Nested Functions
  • Named Return Values
  • Virtual Functions With Overridden Return Types

    Code Block
    class A
    {
    	public:
    		virtual void* a();
    };
    class B:
    	public A
    {
    	public:
    		virtual B* a(); // Return type changed from void* to
    			(compatible) B*.
    };
  • Java Extensions (like extern "Java", java attributes)
  • Restricting Pointer Aliasing for Member Functions

    Code Block
    class T
    {
    	public:
    		void fn();
    };
    void T::fn () __restrict__
    {
    }

Incompatibilities

  • Function Attributes

    Code Block
    void fatal () __attribute__ ((noreturn));
    void fatal () { }
    typedef void voidfn ();
    volatile voidfn fatal;
     "void fatal()"
  • Member Access Checking

    Code Block
     class A
    {
    	public:
    		void pub_func();
    	protected:
    		void prot_func();
    };
    class B : public A
    {
    	public:
    		void foo()
    		{
    			&A::prot_func;
    		}
    };
  • Attributes After Declarator

    Code Block
    class X
    {
    	public:
    		X(int) {}
    };
    X x(1) __attribute__((aligned (16)));

GCC 3.3.x

Unsupported Features

  • Arrays of Variable Length as Arguments to Functions

    Code Block
     void tester (int len, char data[len][len])
    {
    }
  • Complex Numbers
  • Nested Functions
  • Named Return Values
  • Virtual Functions With Overridden Return Types

    Code Block
     class A
    {
    	public:
    		virtual void* a();
    };
    class B:
    	public A
    {
    	public:
    		virtual B* a(); // Return type changed from void* to
    			(compatible) B*.
    };
  • Java Extensions (like extern "Java", java attributes)
  • Restricting Pointer Aliasing for Member Functions

    Code Block
     class T
    {
    	public:
    		void fn();
    };
    void T::fn () __restrict__
    {
    }

Incompatibilities

  • Function Attributes

    Code Block
    void fatal () __attribute__ ((noreturn));
    void fatal () { }
    typedef void voidfn ();
    volatile voidfn fatal;
  • Member Access Checking

    Code Block
    class A
    {
    public:
    void pub_func();
    protected:
    void prot_func();
    };
    class B : public A
    {
    public:
    void foo()
    {
    &A::prot_func;
    }
    };
  • Attributes After Declarator

    Code Block
    class X
    {
    public:
    X(int) {}
    };
    X x(1) __attribute__((aligned (16)));

...

...

Unsupported Features

  • Arrays of Variable Length as Arguments to Functions

    Code Block
    void tester (int len, char data[len][len])
    {
    }
  • Complex Numbers
  • Nested Functions
  • Named Return Values
  • Virtual Functions With Overridden Return Types

    Code Block
    class A
    {
    	public:
    		virtual void* a();
    };
    class B:
    	public A
    {
    	public:
    		virtual B* a(); // Return type changed from void* to
    			(compatible) B*.
    };
  • Java Extensions (like extern "Java", java attributes)
  • Restricting Pointer Aliasing for Member Functions

    Code Block
    class T
    {
    	public:
    		void fn();
    };
    void T::fn () __restrict__
    {
    }

Incompatibilities

Function Attributes

...

GCC 4.0.x

Unsupported Features

  • Arrays of Variable Length as Arguments to Functions

    Code Block
    void tester (int len, char data[len][len])
    {
    }
  • Complex Numbers
  • Nested Functions
  • Virtual Function With Overridden Return Type

    Code Block
    class A
    {
    	public:
    		virtual void* a();
    };
    class B:
    	public A
    {
    	public:
    		virtual B* a(); // Return type changed from void* to (compatible) B*.
    			// It is ok in GCC but EDG will complain
    };
  • Java Extensions (like extern "Java", java attributes)
  • Offsetof extension
  • Restricting Pointer Aliasing for Member functions

    Code Block
    class T
    {
    	public:
    		void fn();
    };
    void T::fn () __restrict__ // EDG won't compile this
    {
    }

Incompatibilities

  • Function Attributes

    Code Block
    void fatal () __attribute__ ((noreturn));
    void fatal () { }
    typedef void voidfn ();
    volatile voidfn fatal; // EDG: declaration is incompatible with
    // "void fatal()"
  • Friend Declarations

    Code Block
    class A;
    namespace N {
    	class B {
    		friend class A; // In GCC 4.0+ it refer to N::A (which has not been
    			// declared yet) But EDG and older GCCs refer to ::A
    		int _private;
    };
    	class A {
    		void foo()
    		{
    			B b;
    			b._private = 0; // EDG inaccessible field.
    		}
    	};
    }

...