gcc warning about type punned pointers and patch

FireFly Media Server Firefly Media Server Forums Firefly Media Server Nightlies Feedback gcc warning about type punned pointers and patch

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #199
    pietu
    Guest

    I’ve been compiling nightlies for a while and my FC4box gives annoying information about referencing type punned pointer.

    dispatch.c:964: warning: dereferencing type-punned pointer will break strict-aliasing rules
    dispatch.c:893: warning: dereferencing type-punned pointer will break strict-alliasing rules

    I just googled “type punning” and found some kind solution to fix it. I’m not a coder so this “patch” may break something ? Anyway I’m using it right now and as far as I know it works…

    — src/dispatch.c 2006-03-07 09:04:33.000000000 +0200
    +++ src/dispatch.c 2006-03-11 09:17:19.000000000 +0200
    @@ -890,7 +890,7 @@
    tempstring=strdup(ws_getvar(pwsc,”dmap.itemid”));
    current=(unsigned char*)tempstring;

    – while((token=strsep((char**)&current,”,”))) {
    + while((token=strsep((char**) (char*)&current,”,”))) {
    if(token) {
    /* FIXME: error handling */
    db_add_playlist_item(NULL,pqi->playlist_id,atoi(token));
    @@ -961,7 +961,7 @@
    tempstring=strdup(ws_getvar(pwsc,”dmap.itemid”));
    current=(unsigned char *)tempstring;

    – while((token=strsep((char**)&current,”,”))) {
    + while((token=strsep((char**) (char *)&current,”,”))) {
    if(token) {
    /* FIXME: Error handling */
    db_delete_playlist_item(NULL,pqi->playlist_id,atoi(token));

    #4096
    rpedde
    Participant

    in cvs. Thanks.

    — Ron

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Nightlies Feedback’ is closed to new topics and replies.