Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda