On 11/4/25 15:11, Richard Henderson wrote:
On 11/3/25 14:20, [email protected] wrote:
+static void i82596_init_dump_area(I82596State *s, uint8_t *buffer)
+{
+    memset(buffer, 0, DUMP_BUF_SZ);
+
+    printf("This is the dump area function for i82596 QEMU side\n"
+            "If you are seeing this message, pleasecontact:\n"
+            "Soumyajyotii Sarkar<[email protected]>\n"
+"With the process in which you encountered this issue:\n"
+            "This still needs developement so,\n"
+            "I will be more than delighted to help you out!\n"
+        );
+
+    auto void write_uint16(int offset, uint16_t value)
+    {
+        buffer[offset] = value >> 8;
+        buffer[offset + 1] = value & 0xFF;
+    }
+    auto void write_uint32(int offset, uint32_t value)
+    {
+        write_uint16(offset, value >> 16);
+        write_uint16(offset + 2, value & 0xFFFF);
+    }

Doesn't build with macos clang.

https://gitlab.com/qemu-project/qemu/-/jobs/11967951995

../hw/net/i82596.c:1468:5: error: function definition is not allowed here
  1468 |     {
       |     ^
../hw/net/i82596.c:1473:5: error: function definition is not allowed here
  1473 |     {
       |     ^
../hw/net/i82596.c:1478:5: error: call to undeclared function 'write_uint16'; 
ISO C99 and later do not support implicit function declarations 
[-Wimplicit-function-declaration]
  1478 |     write_uint16(0x00, (s->config[5] << 8) | s->config[4]);
       |     ^
../hw/net/i82596.c:1503:5: error: call to undeclared function 'write_uint32'; 
ISO C99 and later do not support implicit function declarations 
[-Wimplicit-function-declaration]
  1503 |     write_uint32(0xB4, s->crc_err);
       |     ^
4 errors generated.


Anyway, nested functions doesn't seem like a great idea.

True.
I'll clean that up, add the Tested-by from Guenter Roeck and
resend during the next 1-2 hours..

Thanks!
Helge

Reply via email to