1

The last time I heavily used C was years ago, and it was strictly done on the Windows platform.

Now, I am taking a class where it is required to develop programs to be ANSI C compliant and the code will be compiled using gcc

we a are required to compile the code using: gcc -g -ansi -pedantic -Wall

how can I reproduce this on MSVS2010? I don't like Ubuntu.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
Nahum
  • 6,959
  • 12
  • 48
  • 69
  • 1
    ANSI _what_ exactly? 89, 90, 99 or 1x? In any case, it's ISO nowadays, all ANSI do is rubberstamp them :-) And, if you want 99 or better, I'd steer well clear of Microsoft. They're not exactly famous for their compliance efforts (more infamous really). In any case, if you are "required" to compile using GCC, MSVC is not the way to go. – paxdiablo Nov 03 '11 at 06:35
  • @paxdiablo thats 89 the strictest. no signed unsigned compare, no `//` comments. freaking hell. – Nahum Nov 03 '11 at 06:47
  • 1
    @NahumLitvin Why don't you just go ahead and use Visual Studio or whatever and when time comes compile everything with `gcc` and see what stops working. – cnicutar Nov 03 '11 at 06:49
  • I think "freaking hell" describes your situation perfectly :-) You may want to ask your educators why they insist on using 20-year-old tech, just be prepared to duck. Code::Blocks is the one I usually recommend under Windows since it uses gcc under the hood and `gcc` can be quite the pedant in pedantic mode. But, since Dan has already stated that, I'll upvote his answer rather than pollute the stackosphere with my ramblings :-) – paxdiablo Nov 03 '11 at 07:04

2 Answers2

4

If you only dislike Ubuntu, there are other options for using GCC. For example, you can look into MinGW, which is a full set up of gcc and all related tools for windows. There are also a few IDEs, like Eclipse and Code::Blocks which I'm pretty sure ship with a C compiler that you can configure however you need. There are also other linux distributions or the option of mac if you'd like to try those out.

(Sorry, don't know anything about MSVC, but GCC is pretty much the standard)

Dan
  • 10,531
  • 2
  • 36
  • 55
1

And it still could be useful to use Ubuntu, because I assume your class will later give you an exercise with e.g. Posix system calls to use, and then it is better to use some Linux distribution (if you dislike Ubuntu graphical interface Unity, you can use something else).

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547