This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA]: Remove warnings from ada-exp.tab.c compilation



PS:
+      tempbuf = (char *) realloc (tempbuf, tempbufsize);
the cast is redundant - realloc returns (void *).


Yeah, well, call it a personal quirk, call it an act of rebellion.
But when I see an ISO standard that tells me I don't need this conversion
by saying that

"A pointer to void shall have the same representation and alignment requirements as a pointer to a character type."

and then tells me IN A FOOTNOTE that

   "The same representation and alignment requirements are meant to
    imply interchangeability as arguments to functions, return values
    from functions, and members of unions."

the horror I feel at this shameless confusion of abstraction layers is such
that I feel compelled to ignore the passages altogether (:->).

You could make up something like an XREALLOC macro (XCREALLOC?) to go with XMALLOC et.al. That might be needed anyway as while a C compiler doesn't require the cast, a C++ one does.


whichever,
Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]