repeat macro define

53 views
Skip to first unread message

hao jiu

unread,
Jun 4, 2021, 10:14:09 AM6/4/21
to minix3
Hi,
   I can't understand the repeat macro define, what's the special meaning.
They art at here line 336 and 337, the other two at line 343 344 inside the structure.
Thanks.

Peter Shkenev

unread,
Jun 5, 2021, 11:36:59 AM6/5/21
to minix3
Hello,

I suggest you removing duplicates and trying to compile minix.

Best regards,
Peter

пятница, 4 июня 2021 г. в 17:14:09 UTC+3, milk.d...@gmail.com:

hao jiu

unread,
Jun 7, 2021, 4:46:05 AM6/7/21
to minix3
Hi,
    I recompile with removing duplicates inside the structure. it seems all well at the end of output message, and get a img.

Peter Shkenev 在 2021年6月5日 星期六上午8:36:59 [UTC-7] 的信中寫道:

Пётр Шкенев

unread,
Jun 7, 2021, 5:22:47 AM6/7/21
to min...@googlegroups.com
Hello,

Now you can try to actually run this image. Since this is a multiboot code, you need just to check if your image boots.

If so, that macro duplicates do nothing and you can disregard them.

Best regards,
Peter

пн, 7 июн. 2021 г., 11:46 hao jiu <milk.d...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "minix3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minix3/88735cbc-75cc-44ef-80a0-0a58427ba8aan%40googlegroups.com.

Giovanni

unread,
Jun 7, 2021, 9:33:42 AM6/7/21
to min...@googlegroups.com
On 06/07/2021 10:46 AM, hao jiu wrote:

> I recompile with removing duplicates inside the structure. it seems all
> well at the end of output message, and get a img.

In C language macros have a global scope in the compilation unit and may
not be redefined. Compilers should generate an error if a macro is
redefined with different value unless the macro in undefined before the
new definition. Other generate a warning even if the value is the same.

You can remove duplicates without causing any problem.

Ciao
Giovanni

Murray Smith

unread,
Jun 7, 2021, 3:41:04 PM6/7/21
to min...@googlegroups.com
Even if the macro is within a struct?

--
You received this message because you are subscribed to the Google Groups "minix3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.

Giovanni

unread,
Jun 8, 2021, 5:01:59 AM6/8/21
to min...@googlegroups.com
On 06/07/2021 09:40 PM, Murray Smith wrote:

> Even if the macro is within a struct?

Yes it doesn't matter. They are still global to the scope of the
compilation unit.

Ciao
Giovanni
--
Giovanni Falzoni | mailto:lso...@home.net.it
Via A.Gramsci, 18/A | <http://www.home.net.it/>
20051 Cassina de` Pecchi - Italy |

Пётр Шкенев

unread,
Jun 8, 2021, 5:10:26 AM6/8/21
to min...@googlegroups.com
Hello,

C macros are quite separate from C language itself. They are processed by, hm, preprocessor and are removed from output. So, basically speaking, macros don't have a clue about the rest of C (in fact, you can use macros in non-C files). Actual compiler, in its turn, doesn't see these macros.

Best regards,
Peter



вт, 8 июн. 2021 г., 12:01 'Giovanni' via minix3 <min...@googlegroups.com>:
--
You received this message because you are subscribed to the Google Groups "minix3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.

stux...@gmail.com

unread,
Jun 13, 2021, 1:04:07 AM6/13/21
to minix3
Although it won't be handled right away, if possible, a quick Pull request should be made to fix this duplicate definition issue.

For posterity, here is a permanent link to the commit and line in question (the copy is just below)
-stux
Reply all
Reply to author
Forward
0 new messages