Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4320806
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:40:25+00:00 2026-05-21T08:40:25+00:00

In kernel.h min is defined as: #define min(x, y) ({ \ typeof(x) _min1 =

  • 0

In kernel.h min is defined as:

#define min(x, y) ({                \
    typeof(x) _min1 = (x);          \
    typeof(y) _min2 = (y);          \
    (void) (&_min1 == &_min2);      \
    _min1 < _min2 ? _min1 : _min2; })

I don’t understand what the line (void) (&_min1 == &_min2); does. Is it some kind of type checking or something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T08:40:26+00:00Added an answer on May 21, 2026 at 8:40 am

    The statement

    (void) (&_min1 == &_min2);
    

    is a guaranteed “no-op”. So the only reason it’s there is for its side effects.

    But the statement has no side effects!

    However: it forces the compiler to issue a diagnostic when the types of x and y are not compatible.
    Note that testing with _min1 == _min2 would implicitly convert one of the values to the other type.

    So, that is what it does. It validates, at compile time, that the types of x and y are compatible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a kernel module that creates a entry in /proc/ and does some
I made a kernel: __kernel void square( __global uchar* input, __global uchar* output, const
The kernel is 2.4. On a side note, does anybody knows a good place
Kernel launches in CUDA are generally asynchronous, which (as I understand) means that once
In kernel space, I have the following: char * myData[MAX_BUF_SIZE][2]; I need to define
I need to panic kernel after some operations are done and verify what operation
Kernel-level threads (like Linux and some *BSD systems) or something else? If there is
I'm working on kernel design, and I've got some questions concerning paging. The basic
I'm cross-compiling kernel modules and some libraries on x86 for ppc. Is it possible
in the current linux kernel, when ICMP module receives ECHO REQUEST message, does it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.