Re: first program with pointers to structures and realloc....



Chris Torek <nospam@xxxxxxxxx> writes:

In article <f2vdi3-0op.ln1@xxxxxxxxxxx>
Martin Joergensen <unoder.spam@xxxxxxxxxxxx> wrote:
c:\documents and settings\dell\Desktop\test\main.c(41) : warning
C4133: 'function' : incompatible types - from 'tablevalues *' to
'tablevalues *'

This particular complaint is just plain wrong, however. One of
the types is indeed "tablevalues *", but the other is "struct
tablevalues *". The difference is that the second one has the
keyword "struct" in front of it, announcing to the world (and the
human programmer) that this is in fact a type-name. The first
looks like an ordinary variable name; but if it were, it would be
a syntax error, so it must be an identifier defined via a type-alias.

This makes me wonder whether a C++ compiler is being used. I
wouldn't expect a C compiler to confuse typedefs and structs in
its error messages.

(I didn't read the rest of the thread, so I don't know if there's
something else here that rules out that possibility.)
--
"Given that computing power increases exponentially with time,
algorithms with exponential or better O-notations
are actually linear with a large constant."
--Mike Lee
.



Relevant Pages

  • Re: first program with pointers to structures and realloc....
    ... keyword "struct" in front of it, announcing to the world (and the ... human programmer) that this is in fact a type-name. ... a syntax error, so it must be an identifier defined via a type-alias. ... This makes me wonder whether a C++ compiler is being used. ...
    (comp.lang.c)
  • Re: Why does this.Location.X = 0; generate a compile error?
    ... because Point is a struct and not a class and structs are a value type. ... This code is then translated by the compiler to a method like: ... Keyword here is you are getting a full *new* Point variable so what you ... Point myNewPoint == new Point; ...
    (microsoft.public.dotnet.framework)
  • Re: typedef struct and extern
    ... >when I seperate with a.c and b.c it causees 'syntax error' ... >I was testing extern and struct. ... the compiler needs to know the A definition. ... without prior definition of struct b_tag. ...
    (comp.lang.c)
  • Re: komplexes Problem mit Funktionszeigern
    ... Die Funktion gibt einen struct "by value" zurueck und bei der ... am Borland Compiler, da der Microsoft Compiler ... Man kann Argumente fuer eine Funktion z.B auf dem Stack uebergeben. ... Das funktioniert natuerlich nur fuer "Basis Typen" die in ein Register passen. ...
    (de.comp.lang.c)
  • Re: Naming typedefs
    ... problem that a scalar could be returned in the A register ... to have waste precious cpu cycles copying the struct there ... of the hardware or twentieth century compiler technology. ... # to include the header defining it into every other header (assuming ...
    (comp.unix.programmer)