C++ API

马承珂 fatmck at 163.com
Thu May 3 02:45:30 CEST 2012


Did you use the "-Wall" option? I just write a very easy sample code to test this on Ubuntu12.04 with g++4.6.3.

ev_o2.cpp:
#include "ev.h"
ev_io myev;
void on_read(struct ev_loop *loop, ev_io *watcher, int events) { }
int main()
{
    ev_io_init(&myev, on_read, 0, EV_READ);
    return 0;
}
then use g++ to complie this file:
g++ -O2 -Wall ev_o2.cpp -lev
you will get the warnings for strict-aliasing things.


Sorry for replying so late, too busy these days.



在 2012-04-20 14:38:11,"Marc Lehmann" <schmorp at schmorp.de> 写道:
>On Thu, Apr 19, 2012 at 10:11:17PM +0800, 马承珂 <fatmck at 163.com> wrote:
>> At 2012-04-19 15:35:46,"Marc Lehmann" <schmorp at schmorp.de> wrote:
>> >As an additional info-let: current versions of gcc (at least 4.4+) don't
>> >emit any warnings when compiled with -O2, except in the CVS version, and
>> >there is a bug open in gcc for that one, as it shouldn't warn.
>> 
>> Sorry, I mean g++ when saying gcc, I am using gcc 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC) on fedora16 X86_64, and using gcc 4.6.x on ubuntu11.10.
>
>I just tried with g++-4.6, and get no warnings with -O2.
>
>-- 
>                The choice of a       Deliantra, the free code+content MORPG
>      -----==-     _GNU_              http://www.deliantra.net
>      ----==-- _       generation
>      ---==---(_)__  __ ____  __      Marc Lehmann
>      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
>      -=====/_/_//_/\_,_/ /_/\_\
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20120503/f1b7f8b8/attachment.html>


More information about the libev mailing list