Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
What does operator ':=' mean?

I am trying to compile pthreads for MSVC2015 and found some strange code.

localPtr->wNodePtr->spin := PTW32_TRUE;

What is this line doing?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

As others pointed out := is not a valid C-operator.

However, this "operator" := is found twice in the current "PThread for Windows" source release which seems to be as of v2.9.1.

Both occurencies appear in ptw32_OLL_lock.c, which proclaims to "implements extended reader/writer queue-based locks", but does not seem to be part of the pthread*.dll build, so the file ptw32_OLL_lock.c is not passed to the compiler.

Interesting enough the source file in question contains an int main() and is not in the testsub-directory.

All in all this seems to be alpha, beta or it's simply noise, so just delete it.

over 4 years ago · Santiago Trujillo Report

0

IIRC, C standard does not specify anything about := operator. So, most likely, it's not standard C.

However, AFAIK, some languages, which use the = as comparison operator, to separate the assignment from comparison, use := as assignment operator. [Example: Pascal, postgresql]

In some other cases, it carries a meaning that the variable is getting defined and assigned in the same step, to differentiate with normal assignment elsewhere. [Example: GO]

over 4 years ago · Santiago Trujillo Report

0

:= is not a valid operator in C.

It does however have use in other languages, for example ALGOL 68. Basically, for what you want to know, the := in this example is used to assign the variable PTW32_TRUE to localPty->wNodeptr->spin

This is done mostly to remove any ambiguity in code, as to avoid using '=' for assignment.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!