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

  • Home
  • SEARCH
  • 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 7902037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:23:29+00:00 2026-06-03T09:23:29+00:00

The file include/linux/typecheck.h of the Linux kernel 4.16 contains this code. #define typecheck(type,x) \

  • 0

The file include/linux/typecheck.h of the Linux kernel 4.16 contains this code.

#define typecheck(type,x) \
({      type __dummy; \
        typeof(x) __dummy2; \
        (void)(&__dummy == &__dummy2); \
        1; \
}

which checks if x is the same type as the parameter type.

But I can’t understand the line:

 (void)(&__dummy == &__dummy2);

How does comparing the first address of both variables help?

  • 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-06-03T09:23:31+00:00Added an answer on June 3, 2026 at 9:23 am

    Comparing pointers with incompatible types is a constraint violation and requires the compiler to issue a diagnostic. See 6.5.9 Equality operators:

    Constraints

    One of the following shall hold:

    • both operands have arithmetic type;
    • both operands are pointers to qualified or unqualified versions of compatible types;
    • one operand is a pointer to an object or incomplete type and the other is a pointer to a qualified or unqualified version of void; or
    • one operand is a pointer and the other is a null pointer constant.

    and 5.1.1.3 Diagnostics:

    A conforming implementation shall produce at least one diagnostic message (identified in an implementation-defined manner) if a preprocessing translation unit or translation unit contains a violation of any syntax rule or constraint, even if the behavior is also explicitly specified as undefined or implementation-defined. Diagnostic messages need not be produced in other circumstances.

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

Sidebar

Related Questions

I've written a simple module: #define __KERNEL__ #define MODULE #include <linux/kernel.h> #include <linux/module.h> int
/*kprobe_example.c*/ #define FUNCNAME alloc_file /* Find something better. printk() isnt recommended */ #include <linux/kernel.h>
I have this C file ( sample.c ): #include <stdio.h> #define M 42 #define
In Linux, to create a socket we include the sys/socket.h header file and use
My included file (include.php) is this: <?php $myarray=(a,b,c); shuffle($myarray); ?> My main php file
I am compiling my first Linux Kernel Module, when i got this error: from
when i read linux kernel source, i found one line says: #define NCP_SUPER_MAGIC 0x564c
I was inspecting the code of a linux application and i saw the #include
Okay, I'm reading about Linux kernel development and there are some code snippets using
In Ubuntu 11.10 x86_64 I have this this simple test.c file: #include <openssl/ssl.h> int

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.