Re: How to suppress errors in g++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hani Ayoub wrote:
> When I try to compile my code in g++ I get many of the following error:
> invalid conversion from `void*' to `<somthing>'.
> 
> My question is: How can I suppress this error?
> And, shouldn't this message be a Warning and not an Error?

To quote the standard, C.1.2 Clause 3:

Change: Converting void* to a pointer-to-object type requires casting

char a[10];
void *b=a;
void foo() {
  char *c=b;
}

ISO C will accept this usage of pointer to void being assigned to a pointer
to object type. C++ will not.

Rationale: C++ tries harder than C to enforce compile-time type
safety.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux