Menu

ANSI C++ forbids implicit conversion

2003-02-02
2012-09-26
  • Nobody/Anonymous

    I am using Dev-C++ 4.9.7.0 (cc295) under Windows 2000 for gtk – programming.
    Unfortunately I always get many ANSI errors, if I use source code from other people.
    For example I get this many different  ANSI errors like
    ANSI C++ forbids implicit conversion from `void *' in argument passing
    Using a source code of gnome.
    The programmer who made this source code told me it is a mistake of Dev,
    So I would like to ask you wheter you have a solution of this problem.

     
    • Anonymous

      Anonymous - 2003-02-02

      Unlikely to be a mistake of Dev-C++ (or more accurately the MinGW GCC compiler it uses. More likely that GCC is more strict about ANSI compliance.

      The easiest (and most brutal) way of clearing "implicit conversion" errors is to make the conversion explicit with a cast. This tells the compiler that "I am doing this conversion because I know what I am doing". However if it needs a cast, it is often down to a badly designed interface, but with third-party or legacy code you often have to put up with this, (otherwise you'd re-code everything, and introduce new bugs in the process).

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.