0

C++ is case-sensitive. The standard (short) integer is named int. So if my application is using type Int (starts upper-case) that must be different(?) Is INT different again?

The application is a compiler. I'm looking at its parsing, which uses a typical yacc setup. Consider input.c here. Line 206/207 declares the current read position, char and lookahead char. (See comment lines 186 ff.)

static Int    row, column, startColumn;
static int    c0, c1;

What does the upper-case Int mean? And where do I find its typedef? I've looked in #include "machdep.h", "char.h", "storage.h" (all in the same github repo). But #include <ctype.h> I can't find in the repo, nor the application's installation on my machine -- is it in the bowels of the C++ compiler?

(I can supply a lot more info about this application if you need it -- ask away in the comments. I figured better to keep the q short to start with.)

Edit/response: Thank you everybody for the quick and accurate responses in the Comments. @dratenik "having symbols that differ in letter case only is a sure-fire recipe for terrible headaches." Indeed. Headache was what it was giving me, so I'm glad I asked.

AntC
  • 2,623
  • 1
  • 13
  • 20
  • 1
    My guess is that it's defined in the same place as `List`. I doubt very much it's in the C++ compiler or in the C++ standard library. – Bathsheba Jun 14 '21 at 08:32
  • 1
    "_The standard (short) integer is named `int`_" - The standard short integer is named `short int`. – Ted Lyngmo Jun 14 '21 at 08:32
  • 2
    Defined here see https://github.com/FranklinChen/hugs98-plus-Sep2006/blob/54ab69bd6313adbbed1d790b46aca2a0305ea67e/src/prelude.h#L695 `typedef int Int;` – Richard Critten Jun 14 '21 at 08:37
  • 1
    For the meaning of `#include` using angle brackets `<>`, see [What is the difference between #include and #include “filename”?](https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename) – Fabio says Reinstate Monica Jun 14 '21 at 08:39
  • If you want to find out where something is defined, define an incompatible symbol with the same name. The compiler error should tell you where the other one is. –  Jun 14 '21 at 08:42
  • 1
    On a more general note, having symbols that differ in letter case only is a sure-fire recipe for terrible headaches. –  Jun 14 '21 at 08:44
  • Code-spelunking tip: things like fundamental types are often defined in the first included header. – molbdnilo Jun 14 '21 at 08:49

0 Answers0