Menu

#13 mock macro does not accept pointer to forward declared structure

open
nobody
None
5
2014-04-07
2014-03-07
No

If you pass a pointer to a forward declared structure to mock() gcc will throw an error: "error: invalid use of undefined type"

1 Attachments

Discussion

  • Thomas Nilsson

    Thomas Nilsson - 2014-04-05
    • Found in version: -->
    • Group: v1.0beta3 --> v1.0beta5
     
  • Thomas Nilsson

    Thomas Nilsson - 2014-04-05

    Could you supply an example where this patches the problem? I can't seem to construct an example which triggers the compilation error and is then fixed by the patch.

     
  • Walter Brebels

    Walter Brebels - 2014-04-07

    See attachment for an example. I compiled it with:
    $ gcc -lcgreen example.c
    example.c: In function ‘sample_mock’:
    example.c:8:2: error: invalid use of undefined type ‘struct SampleStructure’

    Operating system: Ubuntu 12.04
    Gcc version: 4.6.3

     

Log in to post a comment.

MongoDB Logo MongoDB