Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fucking GCC warnings

Name: Anonymous 2010-11-12 13:54

request for implicit conversion from ‘void *’ to ‘struct keys *’ not permitted in C++

keys = mmap(0, sizeof(struct keys), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);

First: C99 code (-x c -std=c99).
Second: what is going on?

Name: Anonymous 2010-11-13 6:30

>>9

OP, again. There was a typo there...

gcc -x c -std=c99 -Os -g0 -pedantic -Wall -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wsync-nand -Wunused-parameter -Wunknown-pragmas -fstrict-aliasing -fstrict-overflow -Wstrict-overflow=5 -Wfloat-equal -Wtraditional -Wtraditional-conversion -Wdeclaration-after-statement -Wundef -Wbad-function-cast -Wdeclaration-after-statement -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wbad-function-cast -Wc++-compat -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wnormalized=nfkc -Wpacked -Wpadded -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wlong-long -Wvla -Wdisabled-optimization -Wstack-protector -lgmp -lrt -lm -fstack-protector-all -pipe program.c -o program


struct key {
 char *block[SIZE];
};

struct key *keys;

fd = shm_open("/shit", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);

 if (fd == -1)
 {
  perror("/shit");
  return EXIT_FAILURE;
 }

 if (ftruncate(fd, sizeof(struct key)) == -1)
 {
  perror("/shit");
  return EXIT_FAILURE;
 }

 keys = mmap(0, sizeof(struct key), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);

 if (keys == MAP_FAILED)
 {
  perror("shm-mmap");
  return EXIT_FAILURE;
 }

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List