c - What's Causing This Strange Warning When I Compile My Kernel? Passing incompatible pointer type, expected struct * but got struct * -


I hope someone can explain this to me. I am writing my own OS, and writing to the memory manager. When I compile my kernel, I keep getting a strange alert. Warning is quite contradictory for me. The function is getting the type of parameter that is expected, but otherwise if you are complaining. Everything is going well, and I'm able to get information that needs to start my memory manager. Can you tell me what is the reason?

$ HOME / opt / cross / bin / i686-elf-gcc -c -ffreestanding -O2 -Wall-extra -std = gnu99 -ggdb- System src / h -o build / kernel .co src / c / kernel.c

src / c / kernel.c: in function 'kernel_main': src / c / kernel.c: 29: 2: WARNING: 'memory_manager_initialize' Passing the argument '1'

memory_manager_initialize (mboot_ptr); // wtf is the reason for this warning?

from src / h / system.h: 39: 0 to the file, from src / h / multiboot.h: 4, from src / c / kernel C: 1:

src / h / memory.h: 35: 6: note: expected is 'std multiboot *', but the argument is 'start multiboot *'

void memory_manager_initialize (struct multiboot * mboot_ptr);

This is the code for my loader that GRUB calls.

  Announced contraction used for multiboot header.set ALIGN, 1 < & Lt; 0 .set MEMINFO, 1 & lt; & Lt; 1. Set Magic, 0x1BADB002 Set Flange, Separate | MEMINFO Set Chaksam, - (Magic + Flange). Global. Multiboots Eraser code. Exercise BSS Excer & Sections. Multiboot # .line4. Long Magic .Lang Flames Long checks clove. Multiboots Long Code Long Bss .long end .long _start .section .text .global_start .extern kernel_main .type _start, @function _start: push% esp push% ebx cli call kernel_main. Hanga: jmp .hang. Size_start. - _start   

Here is the code from my kernel where the warning is coming.

  int kernel_main (struct multiboot * mboot_ptr, u32int initial_stack) {initial_esp = initial_stack; Gdt_initialize (); Idt_initialize (); Memphis (u8int *) and interrupt_handler, 0, size (ISR) * 256); Enable_interrupts (); Timer_initialize (100); keyboard_initialize (); keyboard_set_handler (kernel_keyboard_handler); vga_set_handler (kernel_vga_handler); MEMSet ((u8int *) Terminal_ Buffer, 0, MAX_TERMINAL_BUFFER_SIZE); // Clear the terminal buffer (when we start to run, insert it into 0) // I have to get the memory management. memory_manager_initialize (mboot_ptr); // wtf is a warning because of this?   

And it is being said that the function is defined as

  zero memory_manager_initialize (struct multiboot * mboot_ptr)   

Either your straight is defined as:

  typedef struct {/ * Content * /} multiboot;   

When it should be defined:

  typedef struct multiboot {// note difference in this line / * content * /} multiboot; Before looking at your definition of    

or struct , your function prototype for memory_manager_initialize () appears.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -