Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-28-2009, 02:18 AM   #1
LQ Newbie
Registered: Jan 2009
Posts: 24

Rep: Reputation: 15
Switches controlling the code compilation -- How to


I had been working on a CPP code for sometime now, without being aware that some parts of its code, especially security related were not being compiled.

Problem was like my product did not work for SSL mode. On analysis, I found that some part of CPP codes inside a switch(ENABLE_SSL_LIBRARY)were not getting compiled at all. And also that this gets set when we do newgrp crypto command on the box.

This left me without lots of doubts. I wanted to understand how these switches work and if this switch was propreitary to my code or something related to Linux.

My questions now are:

1. Switches like the one mentioned above , are they user defined, for my particular code or are they related to Linux/GCC or makefiles?

2.If a user can define such switches to control code compilation, then need to know the concepts/procedures behind it. How is it done ?

Kindly excuse if these are very very basic. But since I could not get proper stuffs on google, I thought I should ask some experts here who could either explain me or point me to appropriate resources (links of articles / tutorials)
Old 08-28-2009, 10:18 AM   #2
Senior Member
Registered: Nov 2005
Distribution: Arch
Posts: 3,163

Rep: Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370
Is that a switch like the C control structure switch? I would guess that the compiler can figure out the value of ENABLE_SSL_LIBRARY at compile time so it decides that some cases of the switch will never be taken and they don't need to be compiled. Hard to say for sure without more context. gcc will warn about such cases if you pass the -Wunreachable-code option to it.

And also that this gets set when we do newgrp crypto command on the box.
What does "this" refer to here?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation problem in c++ template code :( lali.p Programming 2 10-13-2008 06:44 PM
D-ITG compilation error - me or the code? baldy3105 Linux - Software 2 12-08-2006 04:47 AM
compilation error - code 2 jhon Programming 2 08-31-2004 01:54 AM
[Pure-ftpd] Debian compilation switches ?? eriov Linux - Newbie 1 01-21-2004 06:43 AM
[Pure-ftpd] Debian compilation switches ?? eriov Linux - Software 2 01-20-2004 12:36 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration