Skip to contentSkip to conversation

palo/paloio.c:64: warning: implicit declaration of function 'memcmp'

PATCH New Jeroen Roovers 2 participants 4 messages Jul 18, 2013 – Jul 21, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 palo/paloio.c:64: warning: implicit declaration of function 'memcmp'

I have been carrying this patch in the Gentoo repository[1] for quite a while now.

[1]
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-boot/palo/files/palo-1.18-include.patch?view=log

Add missing include for memcmp.

b/palo/paloio.c renamed from a/palo/paloio.c +1 -0
index 518c6a5..64e8e45 100644
@@ -7,6 +7,7 @@
  */
 #include <unistd.h>
 #include <stdio.h>
+#include <string.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
#1 lore raw

PATCH 1/1 palo/palo.c:482:5: /usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments

In file included from /usr/include/fcntl.h:296:0,

                 from palo.c:16:

In function 'open',
inlined from 'do_formatted' at palo.c:482:5:
/usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments

palo/palo.c +1 -1
index 10031fd..fffb7ec 100644
@@ -484,7 +484,7 @@ do_formatted(int init, int media, const char *medianame, int partition,
            error(14, "bootloader");
 
        sprintf(badblockfilename, "/tmp/paloblk-%d", getpid());
-       if ((fd = open(badblockfilename, O_RDWR | O_CREAT | O_TRUNC)) < 0) {
+       if ((fd = open(badblockfilename, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) < 0) {
            perror(badblockfilename);
            exit(1);
        }
#2 lore raw

Re: [PATCH] palo/palo.c:482:5: /usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments

Hi Jeroen,

Quoted 9 lines · Jeroen Roovers

In file included from /usr/include/fcntl.h:296:0,

                 from palo.c:16:

In function 'open',
inlined from 'do_formatted' at palo.c:482:5:
/usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments

Thanks for both patches!
I've just pushed both upstream to the palo git tree.

Both changes aren't that huge, so I'm right now not planning to bump the version number - unless you need it for gentoo...?
Just let me know (or if you have further patches, e.g. gentoo specific files?)

Helge

#3 lore raw

Re: [PATCH] palo/palo.c:482:5: /usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments

Quoted 2 lines · On Sat, 20 Jul 2013 21:53:10 +0200 Helge Deller <[email protected]> wrote:

Thanks for both patches!
I've just pushed both upstream to the palo git tree.

Great!

Quoted 2 lines

Both changes aren't that huge, so I'm right now not planning to bump the version number - unless you need it for gentoo...?

Both patches are already used in Gentoo, so that's fine.

jer